[Pythonmac-SIG] Unicode path problems (was: Re: suggestions for an appscript FAQ)

Henning Hraban Ramm hraban at fiee.net
Sat Mar 15 23:33:49 CET 2008

Am 2008-03-15 um 21:37 schrieb has:

> Henning Hraban Ramm wrote:
>> I struggled a lot with paths containing non-ASCII characters.
> Hmmm. Is this with the 0.18.1 release? Do you get the same problem
> with the current appscript trunk?

Sorry - since yesterday it works (with 0.18.1).
Some problems with appscript seem to appear or disappear  
unreproducable. :-(

E.g. I had big problems with Finder labels - often got "16393" as  
label_index for some tries, until finally the right number showed up.  
Can't reproduce that any more, without changing my installation.

As I posted before, it was a bit hard to find out where to apply  
which unicode conversion to file paths. (And before you advised me  
about mactypes I tried to convert Unix to Mac paths myself, which  
didn't always work.)

This way works for me, hopefully it will last:

myfile = mactypes.Alias(os.path.abspath(unicodedata.normalize('NFD',  
unicode(sys.argv[1], 'utf-8'))))

Greetlings from Lake Constance!
https://www.cacert.org (I'm an assurer)

More information about the Pythonmac-SIG mailing list