Menu

#5 Bad encoding in output files

open
None
7
2005-06-13
2005-01-27
No

At least with the JavascriptWriter, some characters are
not correctly rendered (see attached log).

Assuming the encoding of the generated javascript file
is UTF-8 (should be UTF-16 according to Java doc), and
writting so the HTML page, there's only one character
that does not render correctly.

Beware of :
- the encoding of the original log file
- the encoding of the output of the JavascriptWriter
- the encoding of the HTML page itself

This is a real matter, and it should be taken with care.

Discussion

  • Nicolas BONARDELLE

     
  • Nicolas BONARDELLE

    Logged In: YES
    user_id=555057

    Here's the HTML page I'm talking about :

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html;charset=UTF-8">
    <title>A T4C log</title>
    <link rel="stylesheet" type="text/css" href="barde_t4c.css"
    charset="UTF-8">
    <!-- defer in the following declaration means that the HTML
    rendering agent should continue to render without waiting
    for the script -->
    <script type="text/javascript" src="Keelala@.log.js"
    charset="UTF-8" defer></script>
    </head>
    <body>
    <script type="text/javascript">
    printLog();
    </script>
    <p><a href="http://validator.w3.org/check?uri=referer"><img
    src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML
    4.01!" height="31" width="88" style="border:none;"></a></p>
    </body>
    </html>

     
  • Nicolas BONARDELLE

    Logged In: YES
    user_id=555057

    Ok, I've found the problem : the character encoding is
    ISO-8859-1.
    So it seems that the original encoding of the log is kept
    through the Java process...

    Maybe I should add an "encoding" argument to each
    input/output file.

     
  • Nicolas BONARDELLE

    • assigned_to: nobody --> cbonar
     
  • Nicolas BONARDELLE

    • priority: 5 --> 7
     
  • Nicolas BONARDELLE

    • priority: 7 --> 9
     
  • Nicolas BONARDELLE

    • priority: 9 --> 7
     

Log in to post a comment.

MongoDB Logo MongoDB