Sunday, April 4, 2010

Unicode and action control

Hi,



I'm trying to set the selected profile in the print options section of the Photoshop print dialog. When i try and do this with the profile name using only ascii characters, it works fine, as soon as i put anything else in there, i does not work. Here's the code ( just the important line ) i use:



sPSActionDescriptor-%26gt;PutString(desc0xf8, keyName, (char*)uniData);



What type of stirng is this expecting if i want to pass unicode data and are there any ps API's to create that string.



thanks



AC
Unicode and action control
I don't have an answer, but a general observation:



If you have an API expecting char * data which does not have a length

field, you can be pretty sure that it is expecting a null-terminated

string.



Clearly, a Unicode string (in the Windows or MacOS meaning of Unicode,

UCS-2), is not going to function as a substitute for this: it is

likely to have zero bytes long before the end.



Some char* routines would accept UTF-8 Unicode data, but you'd expect

the documentation to say so. You could try it, however.



Aandi Inston

No comments:

Post a Comment