Monday, March 29, 2010

FullPathToAlias: Character Conversion

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
FullPathToAlias: Character Conversion
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,%26amp;(AliasHandle)temp Alias);



Regards,

Sunil Kumar
FullPathToAlias: Character Conversion
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

No comments:

Post a Comment