Hi Scott,

Yes, I wasn't implying that it would be easy, but it is possible to do, and
might be worthwhile, if you really want to use the functionality of
std::basic_string and you have multiple platforms to cover.

My experience has been that  transcoding to the local code page is only an
answer if you don't mind burning lots of CPU cycles, or you end up sending
most of the content out that way.

Dave



|---------+--------------------------->
|         |           Scott Cantor    |
|         |           <[EMAIL PROTECTED]|
|         |           u>              |
|         |                           |
|         |           03/24/2004 10:59|
|         |           AM              |
|         |           Please respond  |
|         |           to xerces-c-dev |
|---------+--------------------------->
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                                              |
  |        To:      [EMAIL PROTECTED]                                                  
                                                    |
  |        cc:      (bcc: David N Bertoni/Cambridge/IBM)                               
                                                              |
  |        Subject: RE: Encapsulation of XMLCh* string                                 
                                                              |
  
>--------------------------------------------------------------------------------------------------------------------------------------------------|



> Why not use std::basic_string<XMLCh> instead, if your compiler's standard
> library has templated string classes?

Because newer versions of g++ have strictly followed the C++ standard such
that this is illegal. It is not possible unless you also provide the
complete char_traits support for localization, and that's a ton of work. I
can point to some gcc list threads on this, but the short answer is, try
compiling that template on g++ 3.2 and see what happens. ;-)

Basically on platforms with a 16 bit wchar that uses the same Unicode
encoding as Xerces, things are easy and on other platforms they're
practically impossible to address generally.

My solution was to use local code page a lot unless I knew foreign
characters were likely and then I did a UTF8 transcoding and just played
tricks on the C runtime. Yeah, it sucks...

-- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to