Continuation of #221. Fixes #216 and fixes minetest/minetest#13646.
The Irrlicht string conversion functions are not broken, they are just the wrong kind of conversion functions: Irrlicht uses wide <-> multibyte conversion functions in places where it should actually use wide <-> UTF-8 conversion functions. This usually works because the locale-defined multibyte encoding is UTF-8 in many environments, but sometimes, it doesn't.
This PR introduces new wide <-> UTF-8 conversion functions, utf8ToWString and wStringToUTF8, and uses them where appropriate. wStringToMultibyte is not used anymore and has been removed, multibyteToWString has been kept because it is still used in one place.
EDIT: btw, "AutomatedTest" doesn't even compile on Windows.
To do
This PR is Ready for Review. Before merging, 69622fe641017a10eaf05d0f36186fea424d80ec should be reverted.
How to test
Compile Minetest on Windows with and without SDL. Set a weird combination of language settings. Verify that Unicode text is displayed/copied/whatever-ed correctly.
Continuation of #221. Fixes #216 and fixes minetest/minetest#13646.
The Irrlicht string conversion functions are not broken, they are just the wrong kind of conversion functions: Irrlicht uses
wide <-> multibyte
conversion functions in places where it should actually usewide <-> UTF-8
conversion functions. This usually works because the locale-defined multibyte encoding is UTF-8 in many environments, but sometimes, it doesn't.This PR introduces new
wide <-> UTF-8
conversion functions,utf8ToWString
andwStringToUTF8
, and uses them where appropriate.wStringToMultibyte
is not used anymore and has been removed,multibyteToWString
has been kept because it is still used in one place.EDIT: btw, "AutomatedTest" doesn't even compile on Windows.
To do
This PR is Ready for Review. Before merging, 69622fe641017a10eaf05d0f36186fea424d80ec should be reverted.
How to test
Compile Minetest on Windows with and without SDL. Set a weird combination of language settings. Verify that Unicode text is displayed/copied/whatever-ed correctly.