The characters are not sent in unicode (utf-8) but in the local OS encoding. In 
the mac 
case the characters in the XML data are in mac-Roman.
I've even tried to use ByteArrays to force the text to unicode, using 
ba.writeMultiByte
(text,'utf-8). Still no  luck, when the ByteArray gets converted to string into 
the XML 
stream it is translated back to the host OS encoding.

The only solution so far was to add <?xml version="1.0" enconding="macintosh"?> 
to the 
XML stream. That makes the mac-Roman character recognizable.

I just can't believe there is no way to sent utf-8 encoded XML streams out of 
Flex. Flex 
does take utf-8 XML in, perfectly.
All I need is a way to send it out.

julio

--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> What do you mean by "fail"
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] 
On Behalf Of fourctv
> Sent: Tuesday, September 25, 2007 10:32 AM
> To: [email protected]
> Subject: [flexcomponents] how to add utf-8 multibyte chars to XML
> 
> 
> 
> I'm generating XML data to sent to a webservice and having trouble with utf-8 
> multibyte 
> characters.
> For example é, ç, ñ, those characters are being sent in the machines native 
> encoding 
(mac 
> roman in my case).
> 
> The code that generates the XML goes somewhat like this:
> 
> var resultXML:XML = new XML(<recordData/>);
> ...
> ...
> resultXML.appendChild(XML('<field><![CDATA['+o.text+']'+']></field>')); // 
> trick to 
> send text as CDATA
> ...
> 
> If the object has only USASCII chars it all works fine but fails with 
> characters above 
> ascii-127.
> 
> I've not been able to find a method to convert my text to multibyte utf-8.
> Is there such a thing in Flex/Flash?
> 
> Is there any other way to ensure my xml data is a true utf-8 stream?
> 
> TIA
> julio
>


Reply via email to