Opened 17 years ago

Closed 14 years ago

#233 closed defect (wontfix)

Xml Parser and Utf-8 support

Reported by: ksgeograf Owned by:
Priority: low Milestone:
Component: Server Version:
Severity: minor Keywords: utf-8 encoding xml byte marks
Cc: External ID:

Description

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?

Change History (2)

comment:1 by jbirch, 17 years ago

Milestone: 2.0

Clearing milestone.

comment:2 by jbirch, 14 years ago

Resolution: wontfix
Status: newclosed
Version: 1.2.0

Old ticket; closing. Kenneth, if you still think it is worth handling BOM, could you enter an enhancement request for it?

Note: See TracTickets for help on using tickets.