Inside Coldfusion MX

"-->

SetEncoding (scope_name,charset)

Description

For 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.

Example

In 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>

Категории