Support Unicode filenames in Windows with sf_wchar_open() #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think #119 didn't go far enough regarding Unicode support.
It seems to work on Windows only as long as the file name can be encoded with
'mbcs'
encoding.This works for me with innocuous names like
"äöüß.wav"
, but it doesn't work for more exotic names like"☃.wav"
.In this PR I'm activating the Windows-only function
sf_wchar_open()
to deal with Unicode file names on Windows.I still don't know how to test all this in a meaningful way (see #122).
I did some informal tests on Windows XP and I'm able to write files with "strange" names, but those strange letters show up as rectangles when viewed in Windows Explorer (which I think is the expected behavior in my case).
I think it would be best to find a Windows system with some Asian language settings (or at least a system that can display the Unicode snowman in file names) to properly test this.