I am not really sure why 3 different ways were added to convert UTF-8 strings to UTF-16 strings. But out of the ones that were added, masking was always the fastest in all of my experiments. I therefore decided: (on a separate branch cause I didn't want to upset anyone)
1) masking should be the one and only utf8_to_utf16 function 2) a similar function should also be used for UTF-32 3) these functions should be used everywhere, and mbrtoc16 and mbrtoc32
should be avoided, since these functions are unimplemented in Wine
And the 3rd point is the whole reason I did any of this to begin with.
This would fix the issue where Wine users are unable to have patches that use UTF-16 strings in any of their options fields and would finally allow me to fix hint files in th10
I am not really sure why 3 different ways were added to convert UTF-8 strings to UTF-16 strings. But out of the ones that were added, masking was always the fastest in all of my experiments. I therefore decided: (on a separate branch cause I didn't want to upset anyone)
1) masking should be the one and only utf8_to_utf16 function 2) a similar function should also be used for UTF-32 3) these functions should be used everywhere, and mbrtoc16 and mbrtoc32 should be avoided, since these functions are unimplemented in Wine
And the 3rd point is the whole reason I did any of this to begin with.
This would fix the issue where Wine users are unable to have patches that use UTF-16 strings in any of their options fields and would finally allow me to fix hint files in th10
The commit in which the 3 utf8_to_utf16 functions were introduced is https://github.com/thpatch/thcrap/commit/d796da6de2a8bd39ee94899392708d01ed1eae28