Re: MacRoman -> UTF8 [solved]
Re: MacRoman -> UTF8 [solved]
- Subject: Re: MacRoman -> UTF8 [solved]
- From: Ben Lachman <email@hidden>
- Date: Sun, 22 Mar 2009 03:48:25 -0400
Just for the record, this was an issue with my HTTP content type
settings and the charset that the input was encoded in, not any issue
with NSString.
->Ben
--
Ben Lachman
Acacia Tree Software
http://acaciatreesoftware.com
email: email@hidden
twitter: @benlachman
mobile: 740.590.0009
On Mar 21, 2009, at 9:57 PM, Clark Cox wrote:
On Sat, Mar 21, 2009 at 3:50 PM, Ben Lachman <email@hidden> wrote:
On Mar 21, 2009, at 5:38 PM, Clark Cox wrote:
On Sat, Mar 21, 2009 at 2:31 PM, Ben Lachman <email@hidden>
wrote:
My software uses UTF8 almost exclusively. However, for some odd
reason,
arguments passed from a perl cgi script to one of my command line
helper
apps are encoded as MacRoman.
Where is the CGI script getting the text, and what encoding does it
start off in?
UTF-8. See the last bit of my post, seemingly they're being
converted
somewhere in the internals of the exec command.
Trust me, there's nothing inside of exec that would do this.
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?
What is the encoding of your terminal set to?
--
Clark S. Cox III
email@hidden
_______________________________________________
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