|
Boost Users : |
From: Maik Beckmann (maikbeckmann_at_[hidden])
Date: 2006-08-02 04:08:54
Hello list, this is my first post to you :)
I've got a problem with handling locales and string_algo.
As an example I want so make this string
"hää?"
uppercase (->"HÃÃ?") by using this piece of code:
<code>
#include <iostream>
#include <locale>
#include <string>
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace boost;
int main(int argc, char** argv) {
string loc_name = "de_DE.utf8";
string str("hää?");
str = to_upper_copy(str,locale(loc_name.c_str()));
// ...should give "HÃÃ?"
cout << str << endl;
// but prints "Hää?"
return 0;
}
</code>
As you see I'm trying to use locales, but it doesn't work. What is my
mistake??
Thanks in advance, Maik
PS:
- I'm using gentoo-linux with gcc-4.1.1
- My locales list:
LANG=de_DE.utf8
LC_CTYPE="de_DE.utf8"
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_ALL=de_DE.utf8
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net