Mailinglist Archive: opensuse-bugs (10021 mails)
| < Previous | Next > |
[Bug 235395] New: glibc wide character output functions don't work.
- From: bugzilla_noreply@xxxxxxxxxx
- Date: Tue, 16 Jan 2007 08:20:14 -0700 (MST)
- Message-id: <bug-235395-21960@xxxxxxxxxxxxxxxxxxxxxxxxx/>
https://bugzilla.novell.com/show_bug.cgi?id=235395
Summary: glibc wide character output functions don't work.
Product: openSUSE 10.2
Version: Final
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: P5 - None
Component: Basesystem
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: zsu@xxxxxxxxxx
QAContact: qa@xxxxxxx
CC: mfabian@xxxxxxxxxx
Recently we just found that wide character output functions, such as fputws,
fputwc, wprintf, fwprintf, fprintf, etc. do not have correct behaviour.
Tried the following sample under zh_CN.UTF-8 locale:
(Following sample is utf-8 encoded.)
#include <stdio.h>
#include <wchar.h>
int main ()
{
const wchar_t *str = L"大家好\n";
FILE *fp = fopen ("utf.txt", "wb");
if (fwide (fp, 1) != 1) {
printf ("fail.\n");
return 0;
}
fputws(str, fp);
fprintf (fp, "%ls\n", str);
fputwc (0x4e00, fp);
fclose (fp);
}
The expected behaviour of this piece of code is: UTF-8 chinese string
"大家好" should be written into file utf.txt twice. An unicode character
0x4e00 should be converted into utf-8 sequence and written into utf.txt.
But the actual result of fputws is just three question mark "???".
fprintf outputs nothing at all. fputwc wrote one question mark.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Summary: glibc wide character output functions don't work.
Product: openSUSE 10.2
Version: Final
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: P5 - None
Component: Basesystem
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: zsu@xxxxxxxxxx
QAContact: qa@xxxxxxx
CC: mfabian@xxxxxxxxxx
Recently we just found that wide character output functions, such as fputws,
fputwc, wprintf, fwprintf, fprintf, etc. do not have correct behaviour.
Tried the following sample under zh_CN.UTF-8 locale:
(Following sample is utf-8 encoded.)
#include <stdio.h>
#include <wchar.h>
int main ()
{
const wchar_t *str = L"大家好\n";
FILE *fp = fopen ("utf.txt", "wb");
if (fwide (fp, 1) != 1) {
printf ("fail.\n");
return 0;
}
fputws(str, fp);
fprintf (fp, "%ls\n", str);
fputwc (0x4e00, fp);
fclose (fp);
}
The expected behaviour of this piece of code is: UTF-8 chinese string
"大家好" should be written into file utf.txt twice. An unicode character
0x4e00 should be converted into utf-8 sequence and written into utf.txt.
But the actual result of fputws is just three question mark "???".
fprintf outputs nothing at all. fputwc wrote one question mark.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
| < Previous | Next > |