[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: expat and encodings

  • From: Clark Cooper <coopercl@s...>
  • To: stevek@f...
  • Date: Wed, 16 Dec 1998 09:00:59 -0500 (EST)

expat xml_unicode_wchar_t

Expat always returns to your handlers XML_Char strings, which will be
either UTF-8, UTF-16 encoded as wchar_ts, or UTF-16 encoded as unsigned shorts,
depending on the definition of XML_UNICODE and XML_UNICODE_WCHAR_T when
you compile the library and your program. It provides no option to change
the encoding of strings you receive. This is a wise design choice, since
only the application should know what to do with characters that don't
map from Unicode to the encoding you want to receive. (Even if the document
is in ISO-8859-1, it can contain character references (&#x203e;) or references
to external entities that are in a different encoding.)

You may force the encoding recognized by providing a non-null encoding
name string to XML_ParserCreate. Normally, however, you should pass it a
NULL pointer so that it will recognize and use the XML encoding declaration.

If you were using perl and the XML::Parser perl module built on top of expat,
I could recommend one of the Unicode modules at CPAN (Comprehensive Perl
Archive Network) to help you map from UTF-8 to whatever. Even if you aren't
using perl, you can download one of these to see how to build your own
C function to do encoding mapping.

-- 
Clark Cooper    Logic Technology Inc.		cccooper@l...
(518) 385-8380  650 Franklin St., Suite 304	coopercl@s...
		Schenectady,  NY 12305

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.