Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Unicode filenames in Windows with sf_wchar_open() #129

Merged
merged 2 commits into from
May 15, 2015
Merged

Conversation

mgeier
Copy link
Contributor

@mgeier mgeier commented Apr 13, 2015

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.

@mgeier mgeier added this to the 0.7.1 milestone Apr 13, 2015
@mgeier
Copy link
Contributor Author

mgeier commented Apr 13, 2015

BTW, this is the bug report that made me look into this: libsndfile/libsndfile#74

@bastibe
Copy link
Owner

bastibe commented May 6, 2015

Just... Why, Windows? Why?

Anyway, if this fixes that problem, I guess it's the right thing to do...

What a mess.

@mgeier
Copy link
Contributor Author

mgeier commented May 15, 2015

OK, I tried it on a Korean Windows system ...

Korean characters work just fine (at least on a Korean Windows) with the "mbcs" encoding, so this PR wouldn't be necessary for purely Korean file names (although I didn't try every single Korean letter).

When using "查找問題d.wav" (the offending file name from libsndfile/libsndfile#74), however, "mbcs" doesn't work.
With the current PR (using sf_wchar_open()), it works just fine.

Long story short: I think this is ready for merging!

bastibe added a commit that referenced this pull request May 15, 2015
Support Unicode filenames in Windows with sf_wchar_open()
@bastibe bastibe merged commit 3a132ee into master May 15, 2015
@mgeier mgeier deleted the wchar branch May 16, 2015 14:27
@mgeier mgeier modified the milestones: 0.7.1, 0.8.0 Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants