Bug 4264 - wchar output is broken
Summary: wchar output is broken
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: libstdc++3.3 (show other bugs)
Version: unstable
Hardware: all Linux
: P2 blocker
Assignee: Dmitry V. Levin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-31 12:36 MSD by Alexey Voinov
Modified: 2006-01-07 14:16 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Voinov 2004-05-31 12:36:08 MSD
$ cat > test.c
#include <stdio.h>
#include <wchar.h>
#include <locale.h>

int
main(void)
{
	setlocale(LC_ALL, "");
	wprintf(L"%s\n", setlocale(LC_CTYPE, NULL));
	wprintf(L"[\x0440]\n");
	return 0;
}
$ gcc -std=c99 test.c
$ ./a.out
ru_RU.KOI8-R
[р]
$ cat > test.cc
#include <iostream>
#include <locale>
#include <clocale>

using namespace std;

int main(void)
{
	locale::global(locale(""));
	wcout.imbue(locale(""));
	wcout << L"[\x0440]" << endl;
	return 0;
}
$ g++ test.cc
$ a.out
[$

т.е. программа на C++ в момент вывода символа не из ASCII просто
останавливается. (с кодом завершения 0). Это очень плохо.
Программа на C приведена для демонстрации того, что символ правильный и вывод
wchar_t в libc реализован правильно и работает.
Comment 1 Alexey Voinov 2005-01-11 18:36:28 MSK
fixed in gcc3.4