You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Tom Stockfisch <t....@cox.net> on 2009/04/01 00:33:23 UTC

Re: Xerces on cygwin (was Xerces-C++ 3.0.0 released)

I recently produced an internal database-driven website on cygwin and  
found impossible internationalization issues.  My client is based in  
Toronto so telling them that accents were just not possible I knew  
wouldn't fly.  My input starts from excel files exported in xml format.
I couldn't get XMLString::transcode() to work on anything non-ascii  
in this environment.  Switching to wcstombs() was of no help.   
Everything worked fine in mac os x environment, but cygwin wouldn't  
display any non-ascii correctly.  I finally switched to iconv, which  
was very successful.  I treat the C++ and C char's as UTF-8.  To get  
the strings returned from xerces I use a iconv_open( "UTF-16LE",  
"UTF-8" ).  To send strings from C++ back to xerces I use a
iconv_open("UTF-8", "UTF-16LE").  This works for both cygwin and mac  
os x.

Since XMLString::transcode() isn't officially supported I'm not sure  
if I should report a bug to Xerces.

Tom

Tom Stockfisch
t.stockfisch@cox.net
http://www.tstockfisch.com
760-781-1617 land
760-497-4108 mobile


On Mar 31, 2009, at 1:04 PM, Boris Kolpackov wrote:

> Hi Cris,
>
> Cris Fuhrman <ch...@gmail.com> writes:
>
>> Where can one obtain the Cygwin binaries for Xerces-C 3.0.x?
>>
>> According to http://xerces.apache.org/xerces-c/ 
>> install-3.html#Cygwin they
>> should be in the Cygwin devel group, but I only find 2.8.x  
>> versions from
>> the Cygwin setup.exe program.
>
> Xerces-C++ 3.0.x probably hasn't made it to the Cygwin repository yet.
> However, it is fairly straightforward to build it from sources, as
> explained in the Build Instructions:
>
> http://xerces.apache.org/xerces-c/build-3.html#UNIX
>
> Boris
>
> -- 
> Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/ 
> ~boris/blog
> Open source XML data binding for C++:   http://codesynthesis.com/ 
> products/xsd
> Mobile/embedded validating XML parsing: http://codesynthesis.com/ 
> products/xsde


Re: Xerces on cygwin (was Xerces-C++ 3.0.0 released)

Posted by David Bertoni <db...@apache.org>.
Tom Stockfisch wrote:
> I recently produced an internal database-driven website on cygwin and 
> found impossible internationalization issues.  My client is based in 
> Toronto so telling them that accents were just not possible I knew 
> wouldn't fly.  My input starts from excel files exported in xml format.
> I couldn't get XMLString::transcode() to work on anything non-ascii in 
> this environment.
Perhaps because the local code page under cygwin doesn't support those 
characters.

   Switching to wcstombs() was of no help.  Everything
> worked fine in mac os x environment, but cygwin wouldn't display any 
> non-ascii correctly.  I finally switched to iconv, which was very 
> successful.  I treat the C++ and C char's as UTF-8.  To get the strings 
> returned from xerces I use a iconv_open( "UTF-16LE", "UTF-8" ).  To send 
> strings from C++ back to xerces I use a
> iconv_open("UTF-8", "UTF-16LE").  This works for both cygwin and mac os x.
If your data is encoded in UTF-8, you can always use the Xerces-C 
transcoding service, and create a UTF-8 transcoder.  This will work on 
all of the supported platforms.

> 
> Since XMLString::transcode() isn't officially supported I'm not sure if 
> I should report a bug to Xerces.
I'm not sure what you mean by XMLString::transcode() not being 
officially supported.  It's certainly supported for what it's meant to 
do, which is to transcode between UTF-16 and the platform's local code page.

If you search the archives of the list, you'll discover that 
XMLString::transcode() is often mis-used, which is why you were having 
problems.

Dave