The problem is that on Windows,
čis encoded as a hex value, whereas on a Mac it's split into two characters. The only really secure way to avoid these problems is not to use accented characters in file and folder names. And avoid spaces, too: there are many ftp servers around that don't accept spaces in file names. Use underscores instead, for instance.
I thought that ExtendScript as high level programming language solve this low-level things instead of me. Stupid idea
So I have to redesign whole file management in my project.
It can by solved only:
1) Save the filename directly into created file (eg.: filename.open("w"); file.writeln(filename.name)) and read it back.
2) Reencoded filename to Base64 string - really strange but could help.
3) Don't use accented characters – not acceptable for me in these days of 21. century.
Or any other idea?
The question is what operating systems find acceptable. We all agree that accented characters should be usable on all platforms. But so long as that's not the case, you'd better not use them.
As I wrote at first: My code works on Windows fine because both strings (in JS and get filename) is encoded as UTF (Normal Form Composed) eg.: „č“ is one UTF8 character (2 bytes).
On Mac you get filename in UTF Normal Form Decomposed is „č“ as c + ˇ (accent).
Yes, basic problem is in really old-fashioned file system HFS+.
But Mac OS X API has since 2003 methods for convert Decomposed to Composed form a vice versa: http://developer.apple.com/library/mac/qa/qa1235/_index.html
So why Adobe can't use it in their SW, I don't understand
It is the similar problem as Adobe CS you cannot install on case-sensitive filesystem (new feature in Mac OS X 10.4 ).
I'm sorry, I'm a little bit angry because I spend hours of debuging this stupid problem.
Over all thank you for your time and patience.
@erbenfr – see also the function cleanUmlaut() by Martin Fischer back in 2006 at:
(Discussion in German)
You could easily expand that function like Johannes Puff did in 2012:
At the end I deal with this problem by another way – using indexes/hashes instead of filenames and save filenames into file as text.
For another project I consider your proposals or this https://github.com/walling/unorm - realy robust solution
I think I have the same problem and i spend a lot of time with this bugs…
I have 1 file name from an user dialog box who isn't equal the same file from an indesign link:(
Could you give me an exemple of your code?
I would appreciate your help because I can't fix this problem.