Re: MacRoman -> UTF8
Re: MacRoman -> UTF8
- Subject: Re: MacRoman -> UTF8
- From: Michael Ash <email@hidden>
- Date: Sat, 21 Mar 2009 20:35:11 -0400
On Sat, Mar 21, 2009 at 6:50 PM, Ben Lachman <email@hidden> wrote:
>>> That's not a problem since I can just use
>>> [NSString stringWithCString:argv[i] encoding:NSMacOSRomanStringEncoding].
>>> However it seems that one can't convert MacRoman -> UTF8 after you get
>>> it
>>> into a NSString.
>>
>> I don't know what you mean by "convert MacRoman -> UTF8 after you get
>> it into a NSString". After you get text into an NSString it is, by
>> definition, no longer MacRoman.
>
> Thats what I thought. However, say I start by reading "bén" as I noted
> above, then I call printf("%s", [myStringReadFromMacRoman UTF8String]) and
> it prints "bÈn". However if I call printf("%s", [myStringReadFromMacRoman
> cStringUsingEncoding:NSMacOSRomanStringEncoding]) is prints out correctly.
> Now I'm thoroughly confused and am not sure what's happening. Any more
> thoughts?
All this means is that whatever is displaying your printfs expects
MacRoman encoding rather than UTF-8 encoding. Since we don't know
what's displaying them, it's hard to say anything further.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden