Localization: problems with toupper/tolower transformations of latin characters.
Jan Pfeifer
pfjan@yahoo.com.br
Sun Dec 11 14:45:00 GMT 2005
hi all,
I was trying to get propper transformation for upper/lower case
characters in a generic way, at first in C++, but I noticed that the
libc is apparently not converting correctly the latin characters.
Running the attached code, that tries the C++ and C functions -- later I
found out that libstdc++ uses libc for these, I get:
$ ./test
C++ version:
Ãrfão (original string)
ÃRFãO (should be upper case string)
Ãrfão (should be lower case string)
C version:
Ãrfão
ÃRFãO
Ãrfão
Any ideas about what I could be missing ? Or is the library missing ?
(I tried different locales, as commented in the code, and using UTF-8
for encoding)
thanks in advance for any help/pointers!
- jan
ps.:
$ gcc --version
gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cc
Type: text/x-c++src
Size: 1460 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20051211/60d28025/attachment.bin>
More information about the Gcc-help
mailing list