IconvGNU and IconvFBSD transcoders override application-set locale
------------------------------------------------------------------

                 Key: XERCESC-1660
                 URL: http://issues.apache.org/jira/browse/XERCESC-1660
             Project: Xerces-C++
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.7.0
         Environment: any
            Reporter: Boris Kolpackov
         Attachments: setlocale.patch

When IconvGNU and IconvFBSD transcoders try to figure out the local code page, 
they call setlocale with an empty string as a second argument. This results in 
an implementation-specific action which usually consist of querying a set of 
environment variables and overriding the current locale with the result. This 
is obviously wrong since Xerces-C++ has no business changing the default 
application locale. Out of curiosity I checked how things are done in ICU. I 
found the following comment in the the source code:

"Do not call setlocale(LC_*, "")! Using an empty string instead of NULL, will 
modify the libc behavior."

I came up with a patch that addresses this issue as well as makes the detection 
code more robust.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to