Bug 39243 - Invalid thousands separator in russian locale
Summary: Invalid thousands separator in russian locale
Status: RESOLVED DUPLICATE of bug 16006
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-19 15:20 UTC by Sergey Belyashov
Modified: 2010-01-08 18:47 UTC (History)
5 users (show)

See Also:
Host: i486-linux-gnu
Target: i486-linux-gnu
Build: i486-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Belyashov 2009-02-19 15:20:08 UTC
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)
Comment 1 Paolo Carlini 2010-01-08 18:47:48 UTC

*** This bug has been marked as a duplicate of 16006 ***