#26 XML file is not a valid UTF8

closed
5
2006-10-20
2006-05-12
No

in Main.java(323):

out = new LineWriter(new FileWriter(new File
(outputDir, xmlName + ".xml")), 24 * 1024);

The FileWriter use default encoding and not UTF8.

If you have some remarks attribute with french
characters like 'é', the XML file is invalid.

If you use the other constuctor for FileWriter, all
will be right I think.

out = new LineWriter(new FileOutputStream(new File
(outputDir, xmlName + ".xml")));

Many thanks for your great work!

Bernard

Discussion

  • John Currier

    John Currier - 2006-05-14

    Logged In: YES
    user_id=1264584

    Yes, you're correct Bernard. The LineWriter constructor
    that takes an OutputStream will use UTF8 encoding. I didn't
    realize that XML required it.

    Should the generated HTML pages also be in UTF8?

    Thanks,
    John

     
  • Bernard D'Havé

    Bernard D'Havé - 2006-05-14

    Logged In: YES
    user_id=94842

    The generated pages where column remarks contains the
    char 'é' display right, but I known that in mine projects
    we use OutputStream with UTF8 encoding also. We never use
    a Writer for UTF8 writing.

    But you write HTML with the jvm encoding I think. See the
    following extract:

    <meta HTTP-EQUIV='Content-Type' CONTENT='text/html;
    charset=ISO-8859-1'>

    No need to change it!

    Thanks for your time,
    Bernard

     
  • John Currier

    John Currier - 2006-05-14

    Logged In: YES
    user_id=1264584

    Cool. Note that SourceForge's CVS has been down for quite a
    while now, so the changes won't show up for a bit...

    Thanks,
    John

     
  • John Currier

    John Currier - 2006-10-05

    Logged In: YES
    user_id=1264584

    Fixed in 3.1.0.

    John

     
  • John Currier

    John Currier - 2006-10-05
    • status: open --> pending
     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks