New Windows Unicode solution, works on XP #335

Merged
easyaspi314 merged 2 commits from unicode-xp into dev 2020-03-13 12:15:28 -05:00
easyaspi314 commented 2020-03-10 13:12:04 -05:00 (Migrated from github.com)

Now uses WriteConsoleW instead of vfwprintf. This is codepage independent and works on Windows XP.

Doing this also avoids the _O_U8TEXT hack.

Also use _vsnprintf instead of vsnprintf, as it is more consistent than vsnprintf in that it doesn't write the null terminator on truncation. Weird.

Some minor cleanup was done as well.

Now uses `WriteConsoleW` instead of `vfwprintf`. This is codepage independent and works on Windows XP. Doing this also avoids the `_O_U8TEXT` hack. Also use `_vsnprintf` instead of `vsnprintf`, as it is more consistent than `vsnprintf` in that it doesn't write the null terminator on truncation. Weird. Some minor cleanup was done as well.
easyaspi314 commented 2020-03-10 13:23:08 -05:00 (Migrated from github.com)

Truly fixes #293.

unicode fixed

Truly fixes #293. ![unicode fixed](https://user-images.githubusercontent.com/6258309/76345959-9a56e500-62da-11ea-9595-80ebc1d33eca.png)
flawrist commented 2020-03-10 15:47:41 -05:00 (Migrated from github.com)

Err… I’m a mere user without compiler. Could I have a binary to verify the fix, please?

Err… I’m a mere user without compiler. Could I have a binary to verify the fix, please?
easyaspi314 commented 2020-03-10 17:18:14 -05:00 (Migrated from github.com)
[xxhsum-windows-7328e217.zip](https://github.com/Cyan4973/xxHash/files/4315081/xxhsum-windows-7328e217.zip)
flawrist commented 2020-03-10 17:47:57 -05:00 (Migrated from github.com)

Oh, so many binaries, it makes me confused all the time. Right, I confirm that
xxhsum-i686-mingw-w64.exe and xxhsum-i686-mingw32.exe finally work as expected,
and report that xxhsum-i686-msvc2019.exe cannot be launched (XP says “not Win32 app”).

Oh, so many binaries, it makes me confused all the time. Right, I confirm that ```xxhsum-i686-mingw-w64.exe``` and ```xxhsum-i686-mingw32.exe``` finally work as expected, and report that ```xxhsum-i686-msvc2019.exe``` cannot be launched (XP says “not Win32 app”).
easyaspi314 commented 2020-03-10 17:50:10 -05:00 (Migrated from github.com)

I might have used the wrong filename, or MSVC builds just don't work with XP. I'll test in my VM later.

Edit: Forgot that MSVC sets the minimum version to NT 6.0 a.k.a. Vista. You need to add /link /SUBSYSTEM:CONSOLE,5.1 to support XP.

I might have used the wrong filename, or MSVC builds just don't work with XP. I'll test in my VM later. **Edit:** Forgot that MSVC sets the minimum version to NT 6.0 a.k.a. Vista. You need to add `/link /SUBSYSTEM:CONSOLE,5.1` to support XP.
Sign in to join this conversation.
No description provided.