Better exceptions, investigation on failure to read/print wide chars.
This commit is contained in:
parent
9ff2f14c7d
commit
ae8ba67ed7
13 changed files with 217 additions and 183 deletions
17
utils_src/readprintwc/readprintwc.c
Normal file
17
utils_src/readprintwc/readprintwc.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int main( int argc, char *argv[] ) {
|
||||
fwide( stdin, 1 );
|
||||
fwide( stdout, 1 );
|
||||
|
||||
for (wchar_t c = fgetwc( stdin ); !feof( stdin); c = fgetwc( stdin )) {
|
||||
if (c != '\n') {
|
||||
fwprintf( stdout, L"Read character %d, %C\t", (int)c, c);
|
||||
fputwc( c, stdout);
|
||||
fputws(L"\n", stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue