+ Reply to Thread
Results 1 to 6 of 6

Thread: web.xml encoding problem

  1. #1
    Join Date
    Oct 2006
    Posts
    83

    Default web.xml encoding problem

    Hi,

    I'm trying to load an XML file (UTF-8 encoded) with web.xml and all my special characters are converted to "??"

    any idea ?

    Sample page here : http://developer.mindtouch.com/User:...mattingProblem

    Tks

    Vincent

  2. #2
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    Check the MIME type that is returned by the server from which you're trying to retrieve the resource from. If it's using text/xml, then web.xml will use ASCII as the charset (unless the MIME type include 'charset=utf-8'). Otherwise, if it uses application/xml, then it should work since that's by default interpreted as UTF-8.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  3. #3
    Join Date
    Oct 2006
    Posts
    83

    Default

    Thanks Steve,


    HTTP HEADERS:
    Code:
    Date: Thu, 14 Jan 2010 07:27:24 GMT
    Server: Apache-Coyote/1.1
    Content-Type: text/xml
    Content-Length: 4736
    Via: 1.1 ecatalog.dlpdomain.com
    It's text/xml BUT the xml heading specify the encoding as UTF-8...

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    ...
    Any other idea ?

  4. #4
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    The encoding in the XML declaration is useless since by the time it's read the byte stream has already been decoded using Encoding.ASCII instead of Encoding.UTF8. In the context of HTTP, the XML declaration is close to useless. The encoding is entirely managed by the MIME type. Note that if the MIME type had been "text/xml; charset=utf-8" then it would work fine as well.

    There is fairly little that can be done when the server sends bad data.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  5. #5
    Join Date
    Oct 2006
    Posts
    83

    Default

    Thanks Steve

  6. #6
    Join Date
    Oct 2006
    Posts
    83

    Default

    I had filled a bug report, you can close it

    http://bugs.developer.mindtouch.com/...hp?bug_id=7497

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts