• 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
How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?


  • Subject: How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?
  • From: Gernot A.Pohl <email@hidden>
  • Date: Mon, 17 Aug 2009 18:46:11 +0200

---

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSString *halo = @"Hello, Wörld!";
NSArray *array = [NSArray arrayWithObject:halo];
NSDictionary *dictionary = [NSDictionary dictionaryWithObject:halo forKey:@"halo"];
NSLog(@"%@\narray=%@\ndictionary=%@", halo, array, dictionary);
/* I got on Leopard 10.5.8/Xcode 3.1.2:
2009-08-16 16:45:39.886 WhyDoWeHaveWeirdEncodingInCmdLineOut[2436:813] Hello, Wörld!
array=(
"Hello, W\U00f6rld!"
)
dictionary={
halo = "Hello, W\U00f6rld!";
}


Problem: HOW can I get the SAME NSString description output within the array/the dictionary description output???
I need a real unicode character instead of '\U....' for a 'real' stdout in any NSString encoding but not in the given one (see my example).
(Is this a known description issue? Or a feature which NSString - description does not have?)
Could a NSArray/NSDictionary -descriptionWithLocale: with the right setup help?

*/

[pool drain];
return 0;
}


---_______________________________________________

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: How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: int to bytes(value in NSString)
  • Next by Date: Mac access to iPhone Document Directory
  • Previous by thread: Re: int to bytes(value in NSString)
  • Next by thread: Re: How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?
  • Index(es):
    • Date
    • Thread