1 Reply Latest reply on Jun 23, 2009 5:03 AM by eddieconnecti2009

    URLRequest vs. UTF-8

    eddieconnecti2009

      Hi there!

       

      Don´t know if this is a flex or coldfusion problem. I suggest it results from the type of method, the data is submitted from flex to coldfusion... here is the problem:

      I try to submit data via URLRequest (Method:Post, Content-type:text/xml) to an ColdFusion (UTF-8, ColdBox) application. If i trace the data short befor it is submitted, the data is alright (all cyryllic and other chars are fine). Later, in CF, writing the contents of getHttpRequestData().content down to a file, there is a heavy mismatch in the chars, like "Мощно�?ть, как у ин�?трументов �? �?"

       

      Does anyone know how to fix this? The chars in the textfield in Flex are alright, it´s juast the content beeing sent...

       

      Thanks!

      Eddie

        • 1. Re: URLRequest vs. UTF-8
          eddieconnecti2009 Level 1

          I now fixed the problem. The reason was, if you do not specify encodings for either URL or form variables, coldfusion uses the Java UCS-2 representation of unicode characters*, which is very close to unicode.

          If i set encoding of Form Variables to "UTF-8", this results in a very clean text without mismatch.

           

          <cfset setEncoding( "form", "UTF-8" )>

           

          Thanks for your help!

           

           

           

           

          *coldfusion mx doku/toString(): "New in ColdFusion MX: ColdFusion supports the Java UCS-2 representation of Unicode character values 0-65535. (ColdFusion 5 and earlier releases supported ASCII values 1-255.)"