Switch stdout/stderr to UTF-8 on Windows #323

Merged
easyaspi314 merged 3 commits from unicode-fix-v2 into dev 2020-03-04 10:43:36 -06:00
easyaspi314 commented 2020-03-03 20:03:12 -06:00 (Migrated from github.com)

Uses an adapted version of the fwprintf wrapper suggested by @t-mat,
and _setmode.

Also tries to work around classic MinGW not defining _O_U8TEXT.

Uses an adapted version of the fwprintf wrapper suggested by @t-mat, and _setmode. Also tries to work around classic MinGW not defining _O_U8TEXT.
easyaspi314 commented 2020-03-03 20:05:10 -06:00 (Migrated from github.com)

Awaiting Windows 7 verification from @sergeevabc, in which it will close #293

Awaiting Windows 7 verification from @sergeevabc, in which it will close #293
Cyan4973 (Migrated from github.com) reviewed 2020-03-03 20:44:22 -06:00
@ -182,6 +182,56 @@ static FILE *XXH_fopen_wrapped(const char *filename, const wchar_t *mode)
return f;
Cyan4973 (Migrated from github.com) commented 2020-03-03 20:44:22 -06:00

Maybe not necessary preamble ...

Same comment on L168

Maybe not necessary preamble ... Same comment on L168
easyaspi314 (Migrated from github.com) reviewed 2020-03-03 21:11:38 -06:00
@ -182,6 +182,56 @@ static FILE *XXH_fopen_wrapped(const char *filename, const wchar_t *mode)
return f;
easyaspi314 (Migrated from github.com) commented 2020-03-03 21:11:38 -06:00

Fixed

Fixed
flawrist commented 2020-03-04 04:37:08 -06:00 (Migrated from github.com)

@easyaspi314, I’d gladly verify the binary if there is one.

@easyaspi314, I’d gladly verify the binary if there is one.
flawrist commented 2020-03-04 04:42:30 -06:00 (Migrated from github.com)

Ah, I see @easyaspi314 linked the binary here. Yes, it works as expected.

chcp 65001 
xxhsum.exe привет.txt
a2a5260369b4da80  привет.txt

chcp 1251
xxhsum.exe привет.txt
a2a5260369b4da80  привет.txt

chcp 866
xxhsum.exe привет.txt
a2a5260369b4da80  привет.txt
Ah, I see @easyaspi314 linked the binary [here][1]. Yes, it works as expected. ``` chcp 65001 xxhsum.exe привет.txt a2a5260369b4da80 привет.txt chcp 1251 xxhsum.exe привет.txt a2a5260369b4da80 привет.txt chcp 866 xxhsum.exe привет.txt a2a5260369b4da80 привет.txt ``` [1]: https://github.com/Cyan4973/xxHash/issues/293#issuecomment-594276980
Cyan4973 (Migrated from github.com) approved these changes 2020-03-04 10:43:17 -06:00
Sign in to join this conversation.
No description provided.