• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unicode Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode Characters


  • Subject: Re: Unicode Characters
  • From: Ulrik Sverdrup <email@hidden>
  • Date: Tue, 18 Mar 2003 21:11:28 +0100

I have seen this method to insert a single Unicode character; and it may not be fun to use if you have longer things (like words) to write.
[field setStringValue:[NSString stringWithFormat:@"%C",0x266B]];

Where 0x266B is the address of the unicode character (in this case two notes).
You can find all of them at http://www.unicode.org/charts/

There is also the NSString method
+ (id)stringWithUTF8String:(const char *)bytes
of which I have no experience, but you should try it out.

Ulrik


tisdagen den 18 mars 2003 kl 20.40 skrev Chris Ridd:

On 18/3/03 7:23 pm, Mactov <email@hidden> wrote:

Hi,

Here are a few lines of Obj-C that are, alas, not working.

{
NSString *s;
s=@"@"; //for those who won't read Unicode characters, this is
supposed to be the russian letter "you"
[texteRU setString:s];
}

Where am I mistaking ? I changed my PB prefs to Unicode UTF-8 encoding
and I get the Unicode letters from my keyboard by switching it to
"Unicode Entry" (from the International SysPrefs). I regularly do this
without any problem with TextEdit or Mail and I get the appropriate
character in PB's text editor. But when I launch the app, the rusian
character turns into a "-e" or any 8bit-ASCII string

Why doesn't it work ?

Mactov

The @"..." notation only permits 7-bit ASCII characters inside the string.
You need to think of another way of embedding Unicode text into your program
- there are a couple!

Cheers,

Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Unicode Characters (From: Chris Ridd <email@hidden>)

  • Prev by Date: Re: OT: custom .dmg files
  • Next by Date: Re: Unicode Characters
  • Previous by thread: Re: Unicode Characters
  • Next by thread: Re: Unicode Characters
  • Index(es):
    • Date
    • Thread