Unicode, Windows, MediaCtrl, and QuickTime

The QuickTime mediactrl backend uses a QT API called NativePathNameToFSSpec which builds the FSSpec structure that quicktime uses from a string containing the pathname of the file. Since it is a char string it can not support pathnames with arbitrary Unicode characters, only those that have a matching character in the "system code page of the Windows system."

wxWidgets does convert the Unicode value to a string before passing it to this API. It uses the wxConvLibc converter so anything that doesn't have a representation in the default system encoding will either be dropped or replaced with some other character (I don't remember off the top of my head which way it works) so that means that the encoded pathname it produces will not exist and so QuickTime fails to load it. This also explains why your sample is able to work with Unicode pathnames that have only ascii and latin characters, because they are able to be converted to the local system encoding.

There are some notes I've found online about modernizing QuickTime applications so presumably they use different APIs that can handle Unicode pathnames. This is probably beyond what I have time to do at the moment however so please add a ticket for it on Trac using the wxMSW category.

So for a workaround your idea of doing a chdir to the path containing the file is on the right track. You'll probably also need to do something if the filename is not convertable to the filesystem encoding without losing characters. Perhaps a rename while loading it?

On the other hand, your code calling SetDefaultPyEncoding, and preconverting the pathnames to the filesystem encoding should not have any usable effect on this problem. The pathnames are always going to be converted back to Unicode (or passed through as-is if they already are Unicode) and then encoded using the system's encoding before being passed to the QuickTime API.

···

On 3/20/12 2:46 PM, David wrote:

First, go to Transana.com | Qualitative Analysis Software For Researchers and look for the download
link with your name on it. You can download the necessary

test files

from there. It's 500 MB, so please let me know when you

have got it.

My server guys would prefer I didn't leave large files like this up
for longer than I need to.

I've got it downloaded. I'll try to give it a run later today.

Hi Robin,

Have you had a chance to look into this yet? It continues to drive me nuts.

I take the file "Test ë.mp4" and put it in the directory "E:\Rôbin\亲亳 亲" and it loads fine. Move that file to "E:\Vidëo\亲亳 亲" and it won't load. (By "fine", I mean with the adaptations I made in the sample program I shared with you.) I can't for the life of me figure out what the difference is.

--
Robin Dunn
Software Craftsman