discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

String encoding question


From: Björn Giesler
Subject: String encoding question
Date: Mon, 24 Nov 2003 10:21:46 +0100

Hi,

I'm trying to read vcard files (example attached) exported from Apple's Address 
Book application. I have to use [NSString initWithData:encoding:] on the file 
contents, because that's what Apple's interface specifies.

I've got no idea which encoding these things are in... they look like unicode, 
because there are two bytes for each character, but when I use 
NSUnicodeStringEncoding, the result is garbage (when dumped with NSLog()). When 
I use NSAsciiStringEncoding, NSLog() prints the contents just fine, but the 
resulting string keeps the extra bytes ([str length] returns 22 for 
"BEGIN:VCARD"), so I can't parse the file properly.

Any ideas? I'm thoroughly lost with this encoding stuff.

Thanks in advance,
Björn





reply via email to

[Prev in Thread] Current Thread [Next in Thread]