Is there a way to identify a specific file that has a unicode name (and actually uses those extra characters) with a normal (ANSI) filename?
The library I'm using (id3lib) does have support for unicode ID3 tags, however it says nothing about unicode filenames and the functions that do use filenames only have ANSI parameters.
The old short (8.3) filename can't be used either, as it's most likely ????????.???, even multiple files with that same name :rolleyes:..

Any ideas?

Posted on 2002-04-24 14:47:05 by Thomas
I would give GetShortPathName a shot. There's a possibility that the filename alias is 8.3 *and* ANSI, as Unicode sort of came after long filenames (even though GetShortPathName claims to return a LPTSTR, which would hint at still more unicode). I can see it now: %$!?*@~1.exe... :)

If GSPN doesn't work, I suspect you may be out of luck, because there are 65,536 characters that can map to EACH character in ANSI. File BBAB.TXT and file BBAB.TXT would have the same ANSI filename. That being the case, I suspect they'll want you to NOT be able to get an ANSI version.

Good luck!

Posted on 2002-04-24 18:02:02 by Chalain
Oooh, wild guess, but see if SetFileApisToANSI can help.


Posted on 2002-04-24 18:07:41 by Chalain

Oooh, wild guess, but see if SetFileApisToANSI can help.



GAAAH! Look at me! Look at me! My mouth moves without my brain attached! Yap! Yap! Yap!

I'll bet dollars to donuts that you're already set to ANSI, that's why the short file names are displaying as ????????.???. If you do a SetFileApisToOEM I bet you'd start getting printable 8.3 unicode file aliases.

Hmm... That *still* doesn't tell you how to hand an ANSI filename to your tagger program, does it? Sorry.... :( If you have the source, I wonder if you couldn't rewrite it to accept a file *handle* instead of a filename....

Good luck,

Posted on 2002-04-24 18:12:06 by Chalain
Last thought, and then I'll shut up and leave you alone:

Wrapper the library calls:

TagUnicodeFile proto pwzFileName:DWORD
; pseudocode, because I suck at assembly, remember? :)

; generate unique ANSI filename
; rename unicode file to ansi name
; perform ansi file tagging operation
; rename ansi name back to unicode

TagUnicodeFile endp

More-than-one-way-to-skin-a-cat-ly Yours,

Posted on 2002-04-24 18:17:06 by Chalain
Thanks for the ideas, in fact I do have the source code, as id3lib is open source :)

Posted on 2002-04-25 01:28:29 by Thomas
I've played a bit with short filenames and unicode->ansi conversions but I they all end up in an unusable filename.
The library uses some C library streaming stuff that doesn't support unicode either so rewriting that wouldn't be easy.

Posted on 2002-04-25 11:14:48 by Thomas