This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/39243] New: Invalid thousands separator in russian locale
- From: "Sergey dot Belyashov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2009 15:20:08 -0000
- Subject: [Bug libstdc++/39243] New: Invalid thousands separator in russian locale
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I create this simple program:
#include <iostream>
#include <locale>
#include <clocale>
#include <cstdio>
using namespace std;
int main()
{
locale loc("ru_RU.UTF-8");
cout.imbue(loc);
cout << 1234.56 << std::endl;
setlocale(LC_NUMERIC, "ru_RU.UTF-8");
printf("%'.2f\n", 1234.56);
return 0;
}
Result is:
1?234,56: (in hex): \x31\xC2\x32\x33\x34\x2C\x35\x36
1 234,56: (in hex): \x31\x20\x32\x33\x34\x2C\x35\x36
Here '?' is invalid symbol \xC2
then I try (code in C):
#include <stdio.h>
#include <locale.h>
int main() {
setlocale(LC_ALL, "ru_RU.UTF-8");
printf("\"%s\"\n", localeconv()->thousands_sep);
printf("%f\n", 1234.56);
return 0;
}
Output is: " " (one space in double quotes)
--
Summary: Invalid thousands separator in russian locale
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Sergey dot Belyashov at gmail dot com
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39243