Description
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.