Loading ...

problems when creating XML

Who is online?  0 guests and 1 members
home  »  forums   »  asp.net topics   »  data access   » problems when creating XML

problems when creating XML

Posts under the topic: problems when creating XML

Posted: 8/26/2011

Lurker 160  points  Lurker
  • Joined on: 8/10/2011
  • Posts: 32

I wrote a code to read data from php FORM and then convert it to XML data. When saving it to file it converts encoding to UTF-8 without BOM and then FLASH cannot read special characters. If I manualy save same file to UTF-8 then it works.


Any suggestions???


Posted: 8/26/2011

Starter 727  points  Starter
  • Joined on: 6/6/2011
  • Posts: 74

Hi, 

If the document starts with 0xFF 0xFE or 0xFE 0xFF then the document is UTF-16, if it starts with 0xEF 0xBB 0xBF then it is UTF-8. If neither is found, then there’s no BOM but the detection is about the same: the first character must be a greater then sign (now you know why there is no content or space allowed before it) and that sign is differently encoded in the three major Unicode encodings, including an EBCDIC version of Unicode.

This article will help you handle this issue: http://www.undermyhat.org/blog/2009/08/tip-force-utf8-or-other-encoding-for-xmlwriter-with-stringbuilder/

Best Regards,

Gjorgji


tags Encoding
Page 1 of 1 (2 items)