Discussion:
OpenWatcom v1.9 for Linux vs. unicode
(too old to reply)
e***@yahoo.com
2019-05-30 22:48:37 UTC
Permalink
Using OpenWatcom v1.9 for Linux, how do I print unicode characters to a terminal (xterm)? Using gcc 4.8.2 on Ubuntu, the following works:

#include <stdio.h>

int main() {
printf("hello, world\n");
printf("\u2500\u2501\u25b6\u25ba\u27a4\n");
return 0;
}

Printing: hello, world Then some unicode characters on the next line.

But when I use OW v1.9, it just prints:

hello, world u2500u2501

Thanks for any help!
Paul S Person
2019-05-31 16:36:07 UTC
Permalink
Post by e***@yahoo.com
#include <stdio.h>
int main() {
printf("hello, world\n");
printf("\u2500\u2501\u25b6\u25ba\u27a4\n");
return 0;
}
Printing: hello, world Then some unicode characters on the next line.
hello, world u2500u2501
Thanks for any help!
The OpenWatcom C/C++ User's Guide actually has a sectiom named
"Double-Byte/Unicode Characters", although it's not in the index (for
the HTMLHelp version anyway). I found it by finding "exception" in the
index, selecting "C++ Exception Handling", and pressing "Next" enough
times. This can also be found from the Menu, under compiler options
and the the "full description" part.

The compiler options listed are
zk{0,1,2,l}
zk0u
zku=<codepage>

perhaps one or another of them would help.
--
"I begin to envy Petronius."
"I have envied him long since."
Loading...