Problem for French display in XML/XSL

Discussions

XML & Web services: Problem for French display in XML/XSL

  1. Problem for French display in XML/XSL (7 messages)

    I have a paragraph of French to display on browser, if it is displayed directly by JSP, it works fine. But if I put the French to XML, and display through XSL to JSP, the French characters are in disorder. Not only French, the apostrophe '
    is changed into question mark ?. Our environment is: Weblogic 6.1, JDK1.3, Solaris.

    If it is on WIndows, no such problem.

    Did any one have the same problem? It is appreciate to help me.
    Thanks
    George

    Threaded Messages (7)

  2. George,

    Do you use the same XML parser on both environments ?
    An XML parser is not supposed to support every encoding suitable for French however Unicode is a must so if this is the case try using Unicode.

    Cheers
    Kalin
  3. Answer for[ Go to top ]

    Hi, Kalin

       Yes, I use the same XML parser for WIndows and Solaris, The xml parser is defined by WebLogic JSP tag, I pasrser XML in JSP like the folowing piece of code. I also try XML encoding like "UTF-8" and "ISO-8859-1", neither works on Solaris.

    <%@ taglib uri="xmlx.tld" prefix="x"%>
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <% some things ... %>
    <x:xslt stylesheet="mystyl.xsl">
    <x:xml>
    <%=responseXml ==null? "": responseXml%>
    </x:xml>
    </x:xslt>
    </BODY>
    </HTML>
  4. Answer for[ Go to top ]

    Hi again,

    In fact there are too many places encoding could be broken :-(
    Just examine at every step where you actually lose the desired encoding.
    ... just a reminder ... when you changed the encoding to UTF-8 did you convert the xml file to UTF-8 or you simply changed the encoding attribute.

    Kalin
  5. XML encoding[ Go to top ]

    I simply changed the encoding attribute. But how to convert the XML file to UTF-8

    Thanks
    George
  6. George,

    Don't know if it will help in your case, but we added the following switch to the JVM start in the startup script for WLS:

     -Dfile.encoding=ISO-8859-1

    We also use ISO-8859-1 as the xml encoding for any transformations.

    Thomas

    > I have a paragraph of French to display on browser, if it is displayed directly by JSP, it works fine. But if I put the French to XML, and display through XSL to JSP, the French characters are in disorder. Not only French, the apostrophe '
    > is changed into question mark ?. Our environment is: Weblogic 6.1, JDK1.3, Solaris.
    >
    > If it is on WIndows, no such problem.
    >
    > Did any one have the same problem? It is appreciate to help me.
    > Thanks
    > George
  7. The problem is solved[ Go to top ]

    Hi, Thomas

        The problem is solved, I use
                   -Dfile.encoding=UTF-8
                    and encoding attribute to UTF-8 in XML file.

        Thanks a lot

     George
  8. Check your text in a hex editor, and you will find that not all apostrophes are the same. There are two: &27 and &92. The ones that are 92 will often be converted to question marks (?).