Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#498 "Unknown encoding error" with "iso-8859-15"

Not a Bug
open-rejected
nobody
None
5
2012-04-03
2012-04-03
Anonymous
No

hello,
I have 2 files which looks similar except for the encoding. One (OK) is "iso-8859-1", the other (KO) is "iso-8859-15".
I have tried EXPAT from version 2.0 to 2.1 and both generates an error when parsing the "iso-8859-15" file.
Can you please explain if this is a bug or not and if not why??
I have downloaded expat from this link
http://sourceforge.net/projects/expat/files/expat_win32/2.1.0/expat-win32bin-2.1.0.exe/download
and
http://sourceforge.net/projects/expat/files/expat_win32/2.0.0/expat_win32bin_2_0_0.exe/download

and this is my result
C:\Expat-2.1.0\Bin>dir
Volume in drive C has no label.
Volume Serial Number is 455A-51B9

Directory of C:\Expat-2.1.0\Bin

03/04/2012 16:01 <DIR> .
03/04/2012 16:01 <DIR> ..
03/04/2012 14:35 5.176 FILE_KO.xml
03/04/2012 14:35 1.419 FILE_OK.xml
24/03/2012 15:32 131.584 libexpat.dll
24/03/2012 15:32 17.234 libexpat.lib
24/03/2012 15:32 498.530 libexpatMT.lib
24/03/2012 15:32 134.656 libexpatw.dll
24/03/2012 15:32 17.316 libexpatw.lib
24/03/2012 15:32 515.268 libexpatwMT.lib
24/03/2012 15:32 70.144 xmlwf.exe
9 File(s) 1.391.327 bytes
2 Dir(s) 43.431.870.464 bytes free

C:\Expat-2.1.0\Bin>xmlwf.exe FILE_KO.xml
FILE_KO.xml:1:30: unknown encoding

C:\Expat-2.1.0\Bin>xmlwf.exe FILE_OK.xml

C:\Expat-2.1.0\Bin>

Discussion


  • Anonymous
    2012-04-03

    zip containing test files

     
    Last edit: Anonymous 2013-11-26
    Attachments
  • Karl Waclawek
    Karl Waclawek
    2012-04-03

    • milestone: --> Not a Bug
    • status: open --> open-rejected
     
  • Karl Waclawek
    Karl Waclawek
    2012-04-03

    Expat does not support iso-8859-15. It only supports UTF-8, UTF-16, ISO-8859-1, and US-ASCII. The XML specification does not require an XML parser to support anything else. Your best bet is to convert the document to UTF-8 or UTF-16.

     

  • Anonymous
    2012-04-04

    from what I read here http://www.w3.org/TR/2008/REC-xml-20081126/#charencoding
    it seems that the W3C recognize the importance of the encodings in subject. Especially as this is containing the Euro € symbol.
    [...]
    Although an XML processor is required to read only entities in the UTF-8 and UTF-16 encodings, it is recognized that other encodings are used around the world, and it may be desired for XML processors to read entities that use them. In the absence of external character encoding information (such as MIME headers), parsed entities which are stored in an encoding other than UTF-8 or UTF-16 MUST begin with a text declaration (see 4.3.1 The Text Declaration) containing an encoding declaration:
    [...]

     
  • Karl Waclawek
    Karl Waclawek
    2012-04-04

    I am not sure what you are suggesting. Your quote from the spec basically states that an XML parser only needs to support UTF-8 and UTF-16 encodings, but if another encoding is used it must be inidcated so that parsers that might support these encodings can process them properly.

    Just convert to Unicode, the Euro symbol is part of Unicode, so you should not have a problem.