• 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: Andreas Mayer <email@hidden>
  • Date: Sun, 13 Oct 2002 15:50:05 +0200

Am Sonntag, 13.10.02 um 08:43 Uhr schrieb Michael James:

So my question is is there a way to determine if the string you're about to read is encoded using Unicode, ASCII, or something else?

Not really. But you may try to use UTF8 and if it fails to decode it must be something else. It's quite unlikely that some non-unicode String will decode without errors (and be different from the ASCII version).

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. :-/

But there's some sample code at the unicode site that shows how to use UTF8. It's plain C so you should be able to use it without to much problems. Oh - if you got it working - I could use that one too. ;-)

Of course, if it is *not* UTF8, it may be one of a dozen other 8-bit encodings. And those are way more difficult to differentiate between ...


bye. Andreas.
_______________________________________________
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: Ondra Cada <email@hidden>
References: 
 >Displaying different languages in an NSTableView (From: Michael James <email@hidden>)

  • Prev by Date: Re: [aTask setLaunchPath:@MYLOCALOBJECTIVECROUTINE]
  • Next by Date: Re: Two ways to get this NSTableView behaviour but I do not know how to implement either
  • Previous by thread: Re: Displaying different languages in an NSTableView
  • Next by thread: Re: Displaying different languages in an NSTableView
  • Index(es):
    • Date
    • Thread