[mapguide-trac] #233: Xml Parser and Utf-8 support
MapGuide Open Source
trac_mapguide at osgeo.org
Thu Jul 26 04:59:06 EDT 2007
#233: Xml Parser and Utf-8 support
-------------------------+--------------------------------------------------
Reporter: ksgeograf | Owner:
Type: defect | Status: new
Priority: low | Milestone: 1.3
Component: Server | Version: 1.2.0
Severity: minor | Keywords: utf-8 encoding xml byte marks
External_id: |
-------------------------+--------------------------------------------------
When constructing an Xml document with Utf-8, it is common to insert the
Utf-8 byte-order header: 0xEF, 0xBB, 0xBF before the leading encoding tag:
<?xml version="1.0" encoding="Utf-8" ?>.
Inserting the tag ensures that the document will be displayed correctly
when using non-xml capable editors (ea. text editors).
However, trying to submit an Xml document with the byte order tag gives an
error in the Server:
{{{
An unclassified exception occurred.
An unclassified exception occurred. Exception occurred in method
MgWebLayout.ParseWebLayoutDefinition at line 293 in file
c:\build_bond_area\mapguide_open_source_v1.2\build_18.1\mgdev\web\src\webapp\WebLayout.cpp
}}}
The problem seems to be that the MgXmlUtil::ParseString(...) does not
check for the bytemarks, which makes sense, as it is supposed to read a
string.
I am unsure where to fix this. Perhaps MgUtil::GetTextFromReader(...)
should strip the byte marks before returning the string?
Perhaps MgUtil::GetTextFromReader(...) could be upgraded to handle
multiple encodings, eg Utf-16 and ISO-8859-1?
--
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/233>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list