5
NSSet *subFolders = [_account subscribedFolders];
NSLog(@"subFolders: %@",subFolders);

Output:

...
    "[Gmail]/\U05d8\U05d9\U05d5\U05d8\U05d5\U05ea",
    "[Gmail]/\U05d7\U05e9\U05d5\U05d1" 
...

Is there any way I can show the above text in its original language (Hebrew) ?

Things I tried:

  • changing the debugger from LLDB to GDB - Didn't work
  • Checking under preferences -> Text Editing UTF-* is selected

Thanks

Segev
  • 19,035
  • 12
  • 80
  • 152
  • 1
    maybe this could help: http://stackoverflow.com/questions/3372103/view-unicode-characters-in-xcode-console – CarlJ Apr 17 '13 at 12:30
  • Tried it ,I can't encode the NSSet, I guess it would work for NSString which is not the case. – Segev Apr 17 '13 at 12:31
  • 1
    you can try NSString *desc = [yourNSSet description]; – CarlJ Apr 17 '13 at 12:40
  • Tried to do something like this `NSString *desc = [subFolders description]; NSString *demo=[[NSString alloc] initWithData: [NSData dataWithBytes:(__bridge const void *)(desc) length:[desc length]] encoding:NSUnicodeStringEncoding]; NSLog(@"%@",demo);` And it wouldn't even print the word demo. I got a warning for using desk inside initWithData so I tried using the __bridge but that didn't helped – Segev Apr 17 '13 at 12:51

2 Answers2

2

There is no issue with displaying unicode characters in the console, so I would assume it's the way the string is getting into the set in the first place.

I would suggest iterating over all the objects inside subFolders with something like:

 for( id object in [subFolders allObjects] ) {
    //Print out the name of the item explicitly
 }

Even if this doesn't work, it at least lets you work with the strings directly. If it's still printing out:

"[Gmail]/\U05d8\U05d9\U05d5\U05d8\U05d5\U05ea"

It would look as if you're being sent escaped unicode characters, and I would suggest this: https://stackoverflow.com/a/7861345/352891 - this may work directly on NSSet's description

Community
  • 1
  • 1
user352891
  • 1,181
  • 1
  • 8
  • 14
1
 NSString* strOld=[NSString stringWithFormat:@"%@",responseObject];
NSLog(@"%@",[NSString
             stringWithCString:[strOld cStringUsingEncoding:NSUTF8StringEncoding]
             encoding:NSNonLossyASCIIStringEncoding]);
Gank
  • 4,507
  • 4
  • 49
  • 45