• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem displaying accented characters in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Problem displaying accented characters in NSTextView (From: Rick Hoge <email@hidden>)
 >Re: Problem displaying accented characters in NSTextView (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: [newbie] unknown symbol __ZTVN...
  • Next by Date: Saying "today" in predicates, or, "in the last"
  • Previous by thread: Re: Problem displaying accented characters in NSTextView
  • Next by thread: RE: Problem displaying accented characters in NSTextView
  • Index(es):
    • Date
    • Thread