id summary reporter owner description type status milestone component version severity resolution keywords cc 3634 to_upper / to_lower incorrect for machines with signed chars Thomas Dorner Marshall Clow "I'm using an ISO8859-1 / ISO8859-15 (Latin-1 / Latin-9) character set for the source and a string containing german umlauts is not correctly converted according to the locale configuration. The problem is reproducible on any machine where the default configuration of C/C++ uses signed chars, in our case Sun Solaris: 1. The conversion functions toupper and tolower of the standard C library expect an int parameter. 2. Solaris' characters are signed by default (and Sun explicitly advises against changing that, the manpage of Sunstudio 12.1' CC says about the -xchar option: ""It is strongly recommended that you never use -xchar to compile routines for any interface exported through a library. The Solaris ABI specifies type char as signed, and system libraries behave accordingly. The effect of making char unsigned has not been extensively tested with system libraries. Instead of using this option, modify your code so that it does not depend on whether type char is signed or unsigned. The sign of type char varies among compilers and operating systems."") 3. Characters with an unsinged value >= 128 (e.g. an umlaut) have negative values for toupper and tolower and thus are never converted for any locale. An explicit static cast to unsigned character in the calls to the according standard C libraries function should solve this problem. Note that this may also be needed for other functions as well, e.g. the classification function. I didn't check those so far." Bugs closed Boost 1.41.0 algorithm Boost 1.40.0 Problem fixed