Actually, this issue is being dealt with, though in a different way from
what you indicate. The problem is that the local code page transcoder
really *must* do the local code page, since its used to transcode (among
other things) Unicode text that needs to be passed to local system APIs.
What you really need is the ability to create transcoders for arbitrary
named encodings for output, and I'm working on that stuff right now. What
you did, changing the locale, basically was a round about way of getting
LCP transcoder to work for a different encoding. But this new two way
transcoding support for named encodings will solve these issues.
And we will be building higher level output code on top of the new two way
transcoding which will make output of the XML data much easier.
----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]
"Juergen Hermann" <[EMAIL PROTECTED]> on 03/27/2000 07:05:10 AM
Please respond to [EMAIL PROTECTED]
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
cc:
Subject: Re: Problems with Latin-1 chars
On Mon, 27 Mar 2000 12:55:34 +0100, Juergen Hermann wrote:
>I have the following problem using the xerces-c_1_1_0-linux binary
>distribution:
And I've found the solution. I did not initialize the locale as in the
following code, resulting in "-1" returns from wcstombs(). The whole thing
might be worth an entry in the FAQ.
// initialize locale
char* currentLocale = setlocale(LC_ALL, "");
if (currentLocale)
{
std::cerr << "Locale set to '" << currentLocale << "'" <<
std::endl;
}
else
{
std::cerr << "Unable to set locale!" << std::endl;
}
// initialize Xerces
try
{
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch)
{
std::cerr << "Error during initialization! :\n"
<< CXMLTranscode(toCatch.getMessage()) << std::endl;
exit(EXIT_FAILURE);
}
BTW, the -1 return from wcstombs() is more or less silently ignored in
IconvLCPTranscoder::calcRequiredSize(). I think raising an exception should
be
considered here.
Ciao, Jürgen
--
Jürgen Hermann ([EMAIL PROTECTED])
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22