locked
"ISO-8859-9" xml encoding problem RRS feed

  • Question

  • Hi all,

    I have to parse the xml file to the sql server ce and then show them in the combobox but while parsing i'm having a problem. The framework doesn't support "iso-8859-9" character set, that's what i know. So i use:
    StreamReader str = new StreamReader(this.xmlPath, System.Text.Encoding.GetEncoding(1252)) 

    to convert it, but some characters won't show up. The file in Turkish, so characters like "ş,ç,ö,ı" characters won't come correct.

    What else i can use to correct these.

    Thanks,
    Mehmet Şerif

    Tuesday, December 23, 2008 12:39 PM

Answers

  •  Framework has nothing to do with it – it’s the OS which does not have this encoding. You have several options here:


    1.
          
    Obtain some device which supports this encoding.

    2.       Use different encoding in your XML (UTF-8 is the way to go). This is the best one.

    3.       Use similar encoding – that would mangle some characters (as you already know).

    4.       Write something to convert from unsupported encoding to the supported one. E.g. in the converter which is based on the Stream class read a byte from the stream, use look up table to get matching Unicode character and return it to the Read() caller.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by warrentang Thursday, January 22, 2009 6:13 AM
    Tuesday, December 23, 2008 5:51 PM