SetEncoding (scope_name,charset) DescriptionFor when the locale is anything except English, this sets the character encoding of form scope variable values. Scope name can be either a URL or a form name. ExampleIn this example an example form is set and we are assuming that Japanese Shift-JIS characters are being sent to the processing page. <form action="example.cfm" method="post"> Name: <input type="text" name="exampleName"> Address: <input type="text" name="exampleAddress"> City: Name: <input type="text" name="exampleCity"> </form> <form name="exampleForm" action="example.cfm" method="post"> Name: <input type="text" name="exampleName"> Address: <input type="text" name="exampleAddress"> City: Name: <input type="text" name="exampleCity"> </form> <cfscript> setEncoding("exampleForm", "SHIFT-JIS"); newName = "#exampleForm.exampleName#"; newAddress = "#exampleForm.exampleAddress#"; newCity = "#exampleForm.exampleCity#"; </cfscript> |