OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Request for Discussion: SAX 1.0 in C++

[ Lists Home | Date Index | Thread Index ]
  • From: Steve Harris <sharris@primus.com>
  • To: "XML-DEV mailing list (E-mail)" <xml-dev@ic.ac.uk>
  • Date: Tue, 21 Dec 1999 09:32:32 -0800

Steinar Bang wrote:
> Sure, but how about this, then...?
> 
> typedef unsigned short SAXChar;
> class SAXString : public basic_string<SAXChar> {
> public:
>     SAXString(const SAXString& s, size_type pos = 0, size_type n = npos)
> 	: basic_string<SAXChar>(s,pos,npos) {}
>     SAXString(const SAXChar* p, size_type n)
> 	: basic_string<SAXChar>(p,n) {}
>     SAXString(const SAXChar* p)
> 	: basic_string<SAXChar>(p) {}
>     SAXString(size_type n, SAXChar c)
> 	: basic_string<SAXChar>(n,c) {}
>     SAXString(const char* p)
> 	: basic_string<SAXChar>(p)
>     {
> 	// do UTF-8 to UTF-16 decoding here
>     }
>     
> };

This UTF-8/UTF-16 representation translation seems like a job for Standard
C++'s <locale>/codecvt facility, not something to be embedded in a string
class.
Here's a couple of somewhat relevant Usenet postings that may encourage you
to investigate a more appropriate solution:

http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=530606635&fmt=text
http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=530837402&fmt=text


Steven E. Harris
Senior Software Engineer
PRIMUS

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS