• 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: NSString vs. encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString vs. encoding


  • Subject: Re: NSString vs. encoding
  • From: Joar Wingfors <email@hidden>
  • Date: Wed, 16 Sep 2009 19:32:32 -0700


On 16 sep 2009, at 13.13, Johan Kool wrote:

I have been trying many combinations of encodings/decodings, but without the intended result. I do know what NSString wants, but that's not what I have. I have stringA as shown, and I have to somehow morph it into something usable. Basically I need NSString to interpret the characters a second time, but NSString seems to do all it can to keep it as is. Normally, that's indeed what I want, but not now...


I'm surprised that the most important question has not been asked yet: Where are you getting this string from, and how are you getting it into your application?

If it's not obvious from the API / service / file format that you're getting the string from what encoding that is being used, you can never expect to reliably get this right. The source needs to specify the encoding, and you need to use that encoding when you create your NSString. If I were you I'd stop guessing, and instead spend my time on figuring out what encoding is actually being used. Once you have that, the rest is trivial.

j o a r


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString vs. encoding
      • From: Johan Kool <email@hidden>
References: 
 >Re: NSString vs. encoding (From: Greg Guerin <email@hidden>)
 >Re: NSString vs. encoding (From: Johan Kool <email@hidden>)

  • Prev by Date: Re: settings to build for 10.5 on 10.6?
  • Next by Date: Re: NSInvocation or NSTimer with an arg
  • Previous by thread: Re: NSString vs. encoding
  • Next by thread: Re: NSString vs. encoding
  • Index(es):
    • Date
    • Thread