How to manage NSArray, NSDictionary, ... description encoding for non ascii characters?
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