| ||||||||
GetDeclaredEncoding Methodstatic MCD_STR CMarkup::GetDeclaredEncoding( MCD_CSTR szDoc ); This method can be used to obtain the encoding name from the XML Declaration at the beginning of an XML string without having parsed the string. The reason this is a separate static function, and not a method that operates on the object document, is that often you need to determine the encoding before parsing so you can convert the text encoding before initializing the CMarkup object. Encoding is a large topic that applies to all text files, and an XML file is a text file. See also ANSI and Unicode Files. When an XML file is not stored in a Unicode encoding, the encoding must be specified in the XML Declaration, .e.g. <?xml version="1.0" encoding="Windows-1252"?>
CMarkup has always left most of the work for encoding issues up to the developer, and many customers have been provided with individual encoding solutions specific to their circumstances. The challenge with CMarkup is to add support for common encoding needs without complicating or bogging down the product. Most Western users of text files are not concerned with encoding until they discover a character such as the Euro currency symbol getting corrupted. |
|
Posted December 5, 2004 updated May 14, 2007. Question or comment about this article? ©Copyright 2008 First Objective Software, Inc. All rights reserved. |