Skip to content

Fix inability to access non-ascii path under Windows with WTF-8

NaitLee requested to merge NaitLee/fix-non-ascii-path-on-windows into master

This patch fixes the tough problem “unable to access non-ascii filepath” #63 (closed), by using Windows APIs for “wide characters (wchar)” and converting wchar strings to/from something called “WTF-8” as plain char[] for operation in Darkplaces UTF-8 based system.

It works well on my side, for both Windows systems that:

  • have Chinese (Simplified) locale (for codepages) and language pack, and a Chinese username. Darkplaces tries to access the “Saved Games” folder that contains that Chinese name in path:

屏幕截图_2023-07-10_185150

  • also one, have Português (Brazil) language, Chinese (Simplified) locale, and Cyrillic username:

Capturar

Feel free to test it on your systems, and merge it if successful.

Note: I see one problem left is “My Games” directory is not going well. It would be fixed by using another Windows API. Going to do it. Fixed. No problem left so far.

Another Note: this one is intended to be successor of !139 (closed), please merge either one that works.

It can be backported to div0-stable easily. Do it if you wish.

… And I should “advertise” my another pull request on GitHub, which is completed and is as essential as this one… ;)

Signed-off-by: NaitLee naitli@foxmail.com

Closes #63 (closed)

Edited by bones_was_here

Merge request reports