Logo 
Search:

C# Forum

Ask Question   UnAnswered
Home » Forum » C#       RSS Feeds

There is no Unicode byte order mark. Cannot switch to Unicode.

  Asked By: Doan    Date: Aug 31    Category: C#    Views: 7037
  

Can anyone explain me why i am receiving following error message?

Error : There is no Unicode byte order mark. Cannot switch to Unicode.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Muntasir Bashara     Answered On: Aug 31

Error Message: There is no unicode  byte order  mark. Cannot switch  to Unicode.

This error  generally occur when loading xml file that is encoded in utf-16 format.

Error Parsing message: System.Xml.Exception: There is no Unicode byte  order mark. Cannot switch to unicode.

Error Solutions: What is UTF? Unicode transformation format (UTF) is an algorithmic mapping from every Unicode code point to a unique byte sequence. UTF-8 and UTF-16 are simply different algorithms, but they can both represent any (16 bit) Unicode character.

So What to choose in web applications When we talk about web applications, it's characters exchanged between systems,and here UTF-8 is preferable. Just think of an English language web site using UTF-16. Every character delivered over the web would take two bytes. When using UTF-8, almost all characters would take only one bytes, save for special cases like the Euro symbol. UTF-16 can become quite expensive.So for web apps, stick with UTF-8

More on Unicode
http://www.microsoft.com/globaldev/getWR/nwr/nwrpartVI.mspx

 
This post is locked for further answers.




Tagged: