c# Converting codepage input to display as Unicode -


I searched and found some partial answer in some cases, but nothing that works in all the visibility of the network An XML file is sent through the medium. Encoded file is named eg Encoding = "windows 932" or encoding = "windows-1254" and so on. I need to parse the file and get some information and convert that information to Unicode characters and send it to another machine which can only read Unicode.

It is encoding

  • 1253 if it is Cyrilic then four E1 = ASCII225 = Unicode 0431.

  • 1254 is Turkey, then four E1 = ASCII225 = Unicode 00 E1.

  • 1251 If it is Greek then four E1 = ASCI 225 = Unicode 03 B1.

    So far I thought I could take a lookup table which saw the encoding and then I just add the Unicode page in front of E1, but which will not work as Unicode , As you see above, there is no position on the same page.

    To make things even more complex, I can also get encoding such as Japanese (Shift-JIS) codepace 932. Now all this Japanese does not get from the same page and almost every letter comes on ASCII pages. From a different Unicode page

    So the question is how does C # change XML data in Unicode and correct it all the time? any idea?

      encoding Gate encoding ("windows-1253"). GetString (new byte [] {0xE1}) // - & gt; "\ U03B1" Î ± encoding.Get encoding ("Window-1254"). GetString (new byte [] {0xE1}) // - & gt; "\ U00e1" encoding.Get encoding ("Window-1251"). GetString (new byte [] {0xE1}) // - & gt; You must use an existing XML parser (such as  XmlReader  or  XDocument.load  for an XML file, "\ u0431" Ð ±   

    Code>) that will handle your encoding for you.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -