Re: How is SJIS encoding handled in expat?
Karl Waclawek <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
Agarwal, Saumya wrote: > Thanks Karl. The problem was that XML_ParserCreate(const XML_Char *encoding); function was being called by passing UTF-8 which was overriding the encoding declaration, as you suspected. > > >> Not by default. You must register an "unknownEncodingHandler" that can handle SHIFT-JIS. >> Out of the box, Expat only supports ASCII, ISO8859-1 , UTF-8 and UTF-16 for input. >> For an example, look at patch #888879 on the Expat web site. >> > > Where can I find an encoding handler which can handle SHIFT-JIS? Will expat be able to support both UTF-8 and SHIFT-JIS encoding at the same time if I register such an handler? > > I don't know of a publicly available one. You could roll your own, using the docs and the example I emtioned above (for GB2312), or you could simply convert the SHIFT-JIS input to UTF-8. Just Google for it - there may be some OpenSource available. Karl