FIX: _mbslwr Does Not Handle International CharactersLast reviewed: January 15, 1998Article ID: Q179284 |
The information in this article applies to:
SYMPTOMSThe C run-time function _mbslwr is used to convert uppercase letters in a multibyte-character string to lowercase letters. This function fails to convert characters that are in the range of 128 to 255.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Visual Studio 97 service pack 1.
MORE INFORMATIONThe following sample program demonstrates the problem:
//Sample.cpp // Compiler Options: none #include <stdio.h> #include <locale.h> #include <mbstring.h> int main() { printf("%s\n",setlocale(LC_ALL,"English_United States.1252") ); unsigned char c_Upper = '\xD6' ; //Capital O Umlaut character value=D6h. unsigned char c_Lower = '\xF6' ; //Lower Case O Umlaut character value=F6h. printf( "Before Conversion c_Upper=%Xh c_Lower=%Xh\n", c_Upper, c_Lower ); _mbslwr(&c_Upper); // c_Upper should now be equal to c_Lower =F6h printf( "After Conversion c_Upper=%Xh c_Lower=%Xh\n", c_Upper, c_Lower ); return 0; } Program output: English_United States.1252 Before Conversion c_Upper=D6h c_Lower=F6h After Conversion c_Upper=D6h c_Lower=F6h Expected output: English_United States.1252 Before Conversion c_Upper=D6h c_Lower=F6h After Conversion c_Upper=F6h c_Lower=F6h |
Additional query words: VS97FixlistSP1 CString MakeLower
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |