• 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: Displaying different languages in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying different languages in an NSTableView


  • Subject: Re: Displaying different languages in an NSTableView
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 13 Oct 2002 16:30:01 +0200

On Sunday, October 13, 2002, at 03:50 , Andreas Mayer wrote:

That said, I'm not sure how to do this in cocoa. NSString's initWithData:
encoding: says "data must be an NSData object containing bytes in encoding". Looks like there is no way to know if the decoding worked. :-/

That's just impossible. Each valid UTF8 string is *also* a valid string in any 8-bit encoding. Some heuristics like "there is no 0xfe character in any decent text" help, but are not and can't be completely dependable.

The gist of it, you either have to get the encoding information "externally" (like, from the format description which says "here's a UTF8"
, or "here's the encoding number", or whatever), or you are in for an ugly and *incurrably* stochastic code.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Displaying different languages in an NSTableView
      • From: Andreas Mayer <email@hidden>
References: 
 >Re: Displaying different languages in an NSTableView (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Newbie: app cursors and icons
  • Next by Date: Re: App crashes on thread exit
  • Previous by thread: Re: Displaying different languages in an NSTableView
  • Next by thread: Re: Displaying different languages in an NSTableView
  • Index(es):
    • Date
    • Thread