tfussell / xlnt

:bar_chart: Cross-platform user-friendly xlsx library for C++11+
Other
1.47k stars 409 forks source link

Paths on Windows are now correctly converted from UTF-8 to UTF-16 #607

Closed doomlaur closed 2 years ago

doomlaur commented 2 years ago

Until now, paths on Windows were converted from UTF-8 to UCS-2 instead of being converted to UTF-16. This pull request fixes issues with file paths that use 2 wchar_t characters / 4 bytes, also called surrogate pairs. These are allowed in UTF-16 but not in UCS-2. I also modified the unit tests to test this case.