Unicode and NSTextView
Unicode and NSTextView
- Subject: Unicode and NSTextView
- From: Timothy Larkin <email@hidden>
- Date: Fri, 22 Aug 2003 09:01:08 -0400
My application creates an attributed string containing some high
unicode (> 0xFF) characters. I use [NSTextContainer
setAttributedString:] to put this string into an NSTextView. The
international characters do not display correctly. For instance,
"\u014d" (o-macron) appears as "\u2248 \u00e7.
I get the o-macron into the string by inserting an NSString constant.
Since I can make o-macron directly with Pop-char, I define in the
source @"<o-macron>". This appears correctly in the source file. If I
print it in the debugger, it also looks right. I also get the correct
glyph if I po [NSTextView textStorage]. But the TextView, as I said,
shows something completely different.
If I type o-macron directly into the NSTextView, it appears correctly.
Curiously, after that, the debugger can no longer print the string
correctly. Apparently the debugger and NSTextView have different ideas
about how to represent an NSString that contains high unicode
characters.
I have not been able to find any other way to insert a high unicode
character into a string besides entering the character directly as a
constant NSString. If I try to use a \u format control, the compiler
tells me that it doesn't know what a \u format control is.
I have searched Google and the cocoa-dev archives without furthering my
understanding of this problem. No doubt the solution is trivial, to
someone who knows the answer. Probably the solution will come to me as
soon as I click Send.
--
Timothy Larkin
Abstract Tools
Caroline, NY
_______________________________________________
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.