In OS X, how do I enter a second-plane Unicode character with the standard input method editor?
I want to test that my Cocoa app properly handles input outside the basic multilingual plane, and copy-pasting it is out of the question. I don't know how to key in a character outside BMP! I have set up Japanese as an input source and am able to get random Katakana or Hiragana by typing Japanese-sounding words, but that trick won't work for plane 2 characters. Pasting characters in dismisses the input method editor, so that doesn't work either. I think I actually need to enter the correct keystrokes on my US English keyboard into some language's input source (Chinese, presumably, would be a good choice). In case it's not obvious, I don't speak any Asian languages.
Here's an example of some characters in the second plane: http://www.unicode.org/cgi-bin/UnihanGrid.pl?code开发者_如何学Cpoint=20000
Any unicode character above 0xffff would be acceptable for my purposes as long as I can render the glyph with a font I have or can get for free.
You can easily manually enter any Unicode character by enabling the Character Viewer
panel. In OS X 10.6, go to System Preferences -> Language & Text -> Input Sources
and in the list of input methods on the left, click enable Keyboard & Character Viewer
and on the right side, Show Input menu in menu bar
. That should add an item to the upper right side of the standard OS X menu bar. You can then click on it to select the Character Viewer. In the panel that appears, select View -> Code Tables
. Then, in the Unicode
tab, you can scroll down to any code point, including those outside the BMP. Select that character and click on Insert
to insert it into a text field like this one:
精彩评论