Re: Unicode and RTF?
Re: Unicode and RTF?
- Subject: Re: Unicode and RTF?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 24 Oct 2002 14:25:43 -0700
On Thursday, October 24, 2002, at 11:45 AM, Patrick Narkinsky wrote:
I'm trying to display some UTF-8 encoded text in a TextView. However,
for
reasons not immediately apparent it's not displaying properly.
Anyway, I
came across a reference in the dog book that indicated that RTF is
implemented using 8-bit only characters.
Is that the problem? Can one combine unicode and rtf?
The Cocoa text system is fundamentally Unicode-based. There should be
no particular problem about displaying Unicode text in a text view;
although of course there may be some characters or sequences of
characters that cannot be satisfactorily rendered, either because there
is no suitable font to display them or for lack of some other
information. You do not say how you are getting your text into the
text view; it is likely that the problem lies there. You will probably
want to create an NSString from your UTF-8 sequence, and insert it by
one means or another into the text storage.
There are some subtleties associated with encodings and RTF, but for
the most part Cocoa should handle these issues automatically for you.
In any event, RTF would come into play primarily during copy/paste
operations, or when loading or saving rich text files. It should not
be a factor when you are simply displaying text.
Douglas Davidson
_______________________________________________
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.