Re: Inserting localized text to NSTextView
Re: Inserting localized text to NSTextView
- Subject: Re: Inserting localized text to NSTextView
- From: Murat Konar <email@hidden>
- Date: Wed, 18 Apr 2007 11:30:56 -0700
On Apr 18, 2007, at 11:17 AM, email@hidden wrote:
I have an app with a NSTextView. If, for example, the user selects
Hebrew in the system preference International panel Input Menu,
typing abcd onto the text view produces Hebrew. However, if I
programatically insert abcd using [textView insertText:@"abcd"]
then English, not Hebrew appears in the text view. How can I
programatically insert text onto a text view so that it appears
just as the user typed the text? Thanks.
The translation from "abcd" to whatever Hebrew you're seeing happens
at the keyboard. In other words, typing "abcd" in Hebrew mode doesn't
result in string @"abcd".
To insert Hebrew text into a text view, you have to, well, insert
Hebrew text.
Note also that you can't generally use string literals like @"abcd"
embedded in source code for many languages (source files are parsed
as UTF-8, I believe, and many scripts require UTF-16 to get all
characters). See
<http://developer.apple.com/documentation/MacOSX/Conceptual/
BPInternational/Articles/StringsFiles.html> and the Hillegas book.
_murat
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden