Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

idelovski

macrumors regular
Original poster
In Carbon,

using some code that deals with fonts I got "Osaka\x81\x7c\x93\x99\x95\x9d" as a font name. Is there some document describing such names and how to properly use them? Should I filter them out and how?

For example, I had trouble converting it to CFString. CFStringCreateWithBytes() returns NULL when I pass that name.

Googling around didn't help too much, although there are few sightings of "Osaka\x81\x7c\x93\x99\x95\x9d" string on the web.
 
Yea you're definitely getting some hexadecimal code chunked on the end there. I wish I had more information for you, but without seeing what you're trying to do, I think that's all we can conclude! 🙂
 
I think I got it.

Code:
char * fontName = "Osaka\x81\x7c\x93\x99\x95\x9d";
int    strLen = strlen (fontName);

This returns NULL:
cfStr = CFStringCreateWithBytes (NULL, (const UInt8 *) fontName, strLen, kTextEncodingWindowsLatin2, FALSE);

And this returns a proper CFString:
cfStr = CFStringCreateWithBytes (NULL, (const UInt8 *) fontName, strLen, kTextEncodingISOLatin2, FALSE);

I'm on Tiger.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.