Re: Problem displaying accented characters in NSTextView
Re: Problem displaying accented characters in NSTextView
- Subject: Re: Problem displaying accented characters in NSTextView
- From: Rick Hoge <email@hidden>
- Date: Fri, 14 Oct 2005 07:04:54 -0400
Thanks for the replies - this was the culprit (and fix)!
//NSString *result = [[NSString stringWithContentsOfURL:url] retain];
NSString *result = [[NSString stringWithContentsOfURL:url
encoding:NSUTF8StringEncoding error:nil] retain];
On Oct 14, 2005, at 2:36 AM, Chris Hanson wrote:
On Oct 13, 2005, at 9:01 PM, Rick Hoge wrote:
All works fine, except that accented characters are not displayed
correctly. For example an accented e (é) appears as a square root
sign and a copyright symbol (é). I would have expected this to
'just work' but it doesn't!
Be sure to create the string you display in the NSTextView using
the correct string encoding. There are a wide variety of different
encodings that non-ASCII text can be stored in, with all sorts of
subtle and not-so-subtle differences between them.
I suspect the text is stored in the file using UTF-8 encoding but
you created a string from it using MacRoman encoding, or something
similar.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden