Re: Converting C strings into NSStrings (and vice versa)
Re: Converting C strings into NSStrings (and vice versa)
- Subject: Re: Converting C strings into NSStrings (and vice versa)
- From: Ondra Cada <email@hidden>
- Date: Thu, 27 Apr 2006 16:56:52 +0200
Paolo,
On 27.4.2006, at 16:38, Paolo Bertani wrote:
NSString *s = [NSString stringWithCString:cstring
encoding:kTextEncodingWindowsANSI];
where on earth you got the k-thing from? All the Cocoa constants are
capitalized and have an NS- prefix (so that they don't clash with
other constants).
Namely, the encoding ones have -StringEncoding suffix. What you
probably want here would be NSWindowsCP1251StringEncoding (enter
"nswindows" in the docs search field in Xcode to see all of them).
Incidentally, note also that there is a number of supported encodings
which have no defined symbolic constant. To see them all, try
const NSStringEncoding *ec=[NSString availableStringEncodings];
for (;*ec;ec++) NSLog(@"%@: %d",[NSString
localizedNameOfStringEncoding:*ec],*ec);
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden