FROM : Clark Cox
DATE : Wed Dec 22 21:17:00 2004
On Wed, 22 Dec 2004 13:17:00 +0100, Nestor Cardozo <<email_removed>> wrote:
> I am trying to write programatically a combination of greek and latin
> characters to an NSTextField:
>
> [theNSTextField setStringValue:@"σxx"]
One cannot use non-ASCII characters in @"foo" string literals. You
have several options:
1) Use NSLocalizedString to load your Unicode string from a .strings file
2) Explicitly use character values in the source code:
NSString *myString = [NSString stringWithUTF8String: "\xCF\x83xx"];
or:
const unichar myCharacters[] = {0x03C3,'x','x'};
NSString *myString = [NSString stringWithCharacters: myCharacters
length: sizeof myCharacters / sizeof *myCharacters];
or:
NSString *myString = [NSString stringWithFormat: @"%Cxx", 0x03C3];
--
Clark S. Cox III
<email_removed>
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
DATE : Wed Dec 22 21:17:00 2004
On Wed, 22 Dec 2004 13:17:00 +0100, Nestor Cardozo <<email_removed>> wrote:
> I am trying to write programatically a combination of greek and latin
> characters to an NSTextField:
>
> [theNSTextField setStringValue:@"σxx"]
One cannot use non-ASCII characters in @"foo" string literals. You
have several options:
1) Use NSLocalizedString to load your Unicode string from a .strings file
2) Explicitly use character values in the source code:
NSString *myString = [NSString stringWithUTF8String: "\xCF\x83xx"];
or:
const unichar myCharacters[] = {0x03C3,'x','x'};
NSString *myString = [NSString stringWithCharacters: myCharacters
length: sizeof myCharacters / sizeof *myCharacters];
or:
NSString *myString = [NSString stringWithFormat: @"%Cxx", 0x03C3];
--
Clark S. Cox III
<email_removed>
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
| Related mails | Author | Date |
|---|---|---|
| Nestor Cardozo | Dec 22, 13:17 | |
| Brian Bergstrand | Dec 22, 15:12 | |
| Evan Schoenberg | Dec 22, 20:09 | |
| Clark Cox | Dec 22, 21:17 | |
| The Karl Adam | Dec 22, 23:31 | |
| Clark Cox | Dec 22, 23:46 | |
| The Karl Adam | Dec 23, 07:08 | |
| Clark Cox | Dec 24, 00:25 |






Cocoa mail archive

