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

Re: NSString vs. unicode encoding


  • Subject: Re: NSString vs. unicode encoding
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Wed, 16 Sep 2009 00:26:58 -0500

On Wed, Sep 16, 2009 at 12:10 AM, Johan Kool <email@hidden> wrote:
> Op 15 sep 2009, om 21:50 heeft Jens Alfke het volgende geschreven:
>> On Sep 15, 2009, at 9:04 PM, Johan Kool wrote:
>>
>>> NSString *stringA = @"hello\040world";
>>> NSString *stringB =  [NSString stringWithUTF8String:"hello\040world"] ;
>>
>> I'm confused. '\040' is a regular ascii space character (040 = 32
>> decimal). What's unusual about either of these strings?
>
> Sorry, I was confused by what the actual content of the NSString was in my
> app. It turned out it was @"hello\\040world". I would still like to get that
> to print as "hello world" though, not "hello\040world".

Well... that's not UTF-8, for sure. You might call it ANSI C string
encoding. Looks like Foundation can handle escapes like this as
NSNonLossyASCIIStringEncoding.
_______________________________________________

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. unicode encoding
      • From: Johan Kool <email@hidden>
References: 
 >NSString vs. unicode encoding (From: Johan Kool <email@hidden>)
 >Re: NSString vs. unicode encoding (From: Jens Alfke <email@hidden>)
 >Re: NSString vs. unicode encoding (From: Johan Kool <email@hidden>)

  • Prev by Date: Re: NSString vs. unicode encoding
  • Next by Date: Re: How to debug over-release of private Cocoa object?
  • Previous by thread: Re: NSString vs. unicode encoding
  • Next by thread: Re: NSString vs. unicode encoding
  • Index(es):
    • Date
    • Thread