• 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: converting text input in any encoding to unicode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: converting text input in any encoding to unicode


  • Subject: Re: converting text input in any encoding to unicode
  • From: Clark Cox III <email@hidden>
  • Date: Sun, 27 Apr 2003 08:57:55 -0400

On Sunday, April 27, 2003, at 07:32AM, Ben Dougall <email@hidden> wrote:

>what's the best / usual way from a cocoa app to read in text that's
>potentially encoded with any encoding, in order to store it internally
>in your app in decomposed unicode? i'd like to be able to deal with as
>many encodings as possible - and convert them to the base decomposed
>unicode format in order to compare different texts confidently.

In order to do that, you'd need to have some idea of what encoding the text is in. You can try to discern some encodings, but others will be impossible to differentiate just from looking at the text itself. You can usually identify Unicode text via the BOM, and you can be pretty sure that if the text does not contain any bytes that are greater than 127, then it can be interpreted as ASCII. Other than that, you'd some other hint as to the text's encoding.
_______________________________________________
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: converting text input in any encoding to unicode
      • From: Ben Dougall <email@hidden>
  • Prev by Date: converting text input in any encoding to unicode
  • Next by Date: Re: converting text input in any encoding to unicode
  • Previous by thread: Re: converting text input in any encoding to unicode
  • Next by thread: Re: converting text input in any encoding to unicode
  • Index(es):
    • Date
    • Thread