Re: Unicode and NSTextView
Re: Unicode and NSTextView
- Subject: Re: Unicode and NSTextView
- From: Olivier Destrebecq <email@hidden>
- Date: Fri, 22 Aug 2003 08:40:01 -0500
you want to use some code similar to this:
unichar unicharCode = 0x2318;
value = [NSString stringWithCharacters: &unicharCode length: 1];
i got this code from the mailing list. i would not be able to tell you
why it does not work the other way.
olivier
On Friday, Aug 22, 2003, at 08:01 US/Central, Timothy Larkin wrote:
>
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.
_______________________________________________
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.