|
From: Hisham S. <sue...@ya...> - 2016-09-08 00:38:11
|
Same thing when I encode the string using ANSI. As in:
#include <stdio.h>
int main() { puts("\uFEEB\uFEB8\uFE8E\uFEE1\n");
return 0;}
However by inspecting the properties of the command window I found that its code page is 720 which is the code page for Arabic used by DOS. Windows however uses a different code page for Arabic which is (I believe) is 1256 or something like that which you can check on wikipedia by searching for "code page 720". I am not sure but this might be the reason...hisham...
On Wednesday, September 7, 2016 7:43 PM, Eli Zaretskii <el...@gn...> wrote:
--text follows this line--
> Date: Wed, 7 Sep 2016 17:07:27 +0000 (UTC)
> From: Hisham Sueyllam <sue...@ya...>
>
> I tried both Suggestions [the one from Wu and this one suggested by Eli]. Nothing worked at least for Arabic,
> including piping through perl. By redirecting the Arabic output to a file I can open it and see it correct using any
> editor [I used emacs], but when piping through perl I get garbage or using puts or putchar or whatever. I have
> Windows 10 64-bit and gcc 5.3.0 (the latest)
> By the way if anyone is curious, the Arabic string is my first name:
>
> #include <stdio.h>
>
> int main() {
> puts(u8"هشام\n");
> return 0;
> }
Your email is encoded in UTF-8, and you use Emacs, so I strongly
suspect the Arabic string in your source file was also encoded in
UTF-8. That will never work; you need to encode it in your system's
ANSI codepage, I think. Windows includes only a very sporadic support
for UTF-8, and in particular cannot use it in multibyte strings.
|