Skip to main content
Participating Frequently
August 23, 2007
Question

FullPathToAlias: Character Conversion

  • August 23, 2007
  • 2 replies
  • 582 views
Hi! I use the FullPathToAlias-function to create an alias for open a document in photoshop.
This function works fine with UTF8 names on Windows, but fails on Mac if there are any special characters like 'ü' in the full path. How has the c-string be encoded to make this function work properly?

AliasToFullPath function, which i use to get the full path of the current document seems to use decomposed unicode and utf8. But such strings don't work with FullPathToAlias.

Does anyone know which ones would work?
thanks, richard
This topic has been closed for replies.

2 replies

Participating Frequently
August 29, 2007
I did some further investigations:

@sunil
NewAliasMinimalFromFullPath is a deprecated function and needs a HSF-Path (e.g. Macintosh HD:path:to:somewhere) but I've got a POSIX-Path (e.g. /path/to/somewhere)

FullPathToAlias workes fine with non-unicode full path (POSIX style). I tried some character encodings and I found out that it needs MacRoman encoding. Now i can open german umlauts and so on, but I can't open other unicode characters like chinese signs.

Is there any other possibility for this?

And why does FullPathToAlias expect MacRoman wheras AliasToFullPath returns UTF-8 ?

thanks in advance, richard
Participating Frequently
August 24, 2007
Are you using the below code snippet for Macintosh? If I am not wrong, it is the replacement of "FullPathToAlias" for Macintosh. (I am new in this field).

Handle tempAlias;

#if Macintosh
NewAliasMinimalFromFullPath(strlen(filepath),filepath,nil,nil,&(AliasHandle)tempAlias);

Regards,
Sunil Kumar