xml file encoding

Discussion in 'ASP .Net' started by tomislav.vujnovac@gmail.com, Jan 2, 2006.

  1. Guest

    I need to generate xml file with data from ms sql server.
    That xml is used in some third party java program.
    That program need xml file that is saved as "windows-1250" but in first
    line is: "<?xml version="1.0" encoding="UTF-8"?>"
    When I make xml file as UTF-8, I can not open it with that java
    program, but when I make as "windows-1250" than I can open it but I can
    not see CE characters

    Tomislav
     
    , Jan 2, 2006
    #1
    1. Advertising

  2. Joerg Jooss Guest

    Hello ,

    > I need to generate xml file with data from ms sql server.
    > That xml is used in some third party java program.
    > That program need xml file that is saved as "windows-1250" but in
    > first
    > line is: "<?xml version="1.0" encoding="UTF-8"?>"
    > When I make xml file as UTF-8, I can not open it with that java
    > program, but when I make as "windows-1250" than I can open it but I
    > can
    > not see CE characters


    Simply changing the declaration to another encoding's name doesn't change
    the real encoding. You have to create the XML file accordingly.

    Cheers,
    --
    Joerg Jooss
     
    Joerg Jooss, Jan 2, 2006
    #2
    1. Advertising

  3. TomislaW Guest

    I just realizeI just realize that when I create file from .net I get
    file encoded as "Unicode (UTF-8 with signature) - Codepage 65001".
    The third party java program create files as "Unicode (UTF-8 without
    signature) - Codepage 65001", and can not read file "with signature".
    Is it possible to create "without signature" file from .net?

    Tomislav
     
    TomislaW, Jan 3, 2006
    #3
  4. TomislaW Guest

    I find out solution:
    XmlTextWriter xtw = new XmlTextWriter(_path, new UTF8Encoding(false))
    (false is default)
    so far I have
    XmlTextWriter xtw = new XmlTextWriter(_path, Encoding.UTF8)
     
    TomislaW, Jan 3, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,939
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. Replies:
    1
    Views:
    23,456
    Real Gagnon
    Oct 8, 2004
  3. jkflens
    Replies:
    2
    Views:
    1,515
    jkflens
    May 30, 2006
  4. Erik Wasser
    Replies:
    5
    Views:
    484
    Peter J. Holzer
    Mar 5, 2006
  5. Replies:
    2
    Views:
    391
Loading...

Share This Page