FROM : John Stiles
DATE : Wed Apr 13 01:36:33 2005
That underline means that you're in the middle of an inline input
session. It doesn't necessarily imply double-byte input.
For example, the Korean input manager supports input either with or
without creating an inline input session. In either case, double-byte
characters are generated. Also, the Japanese input manager will input
Japanese text without starting an input session—for example, try
entering a space or a comma. (These do, in fact, generate non-ASCII
characters.)
I'm hard-pressed to think of a concrete example of a language that can
be represented in single-byte that can start an inline input session,
but there are isolated cases where it happens. Technically, halfwidth
Japanese Katakana can be represented in single-byte with SJIS, and can
be input via an inline input session, but that's sort of an edge case.
Basically, here's the real issue: "double-byte" as a concept is just a
complete anachronism nowadays. Everything is Unicode. Unicode can
represent characters as UTF16, where all characters are two bytes wide,
or as UTF8, where individual characters can be between 1 and 4 bytes
long. The idea of code pages is just behind us.
If what you really want to know is "is an inline input session active,"
I know how to do it in Carbon, but not Cocoa. I'm sure someone here can
enlighten you.
Keep in mind that the user can also input characters via other
means—drag-and-drop, Character Palette, paste, etc.—and could introduce
all sorts of non-ASCII text in those ways as well. What exactly are you
trying to do?
On Apr 12, 2005, at 4:26 PM, John Pattenden wrote:
> Well that's not strictly the case, when double byte characters are
> being input Cocoa goes into a special mode. You can tell this since
> the text has a line under it and is not officially "entered" until the
> user presses the enter key. So there is a difference on the input side
> for Double Byte characters - All I need to know is if that mode is
> active or not..
>
>
> John Pattenden
> ScreenTime Media
>
> Get Advice - Give Advice
> http://forums.screentime.com
>
>
>
> On Apr 12, 2005, at 6:57 PM, glenn andreas wrote:
>
>>
>> On Apr 12, 2005, at 5:41 PM, John Pattenden wrote:
>>
>>> Is there a way to determine if double byte text input is active?
>>>
>>> I need to make a special case for my code that does different things
>>> if regular text is being entered vs Japanese or some other Double
>>> Byte text.
>>> thanks for any help
>>>
>>
>> Given that Cocoa uses Unicode for it's user text input, there is no
>> such thing as "regular text" vs "double byte text" - you get an
>> NSString composed of unichars (disregarding, for the moment,
>> surrogate pairs), so your question doesn't really make sense from a
>> Cocoa point of view...
>>
>> What exactly are you trying to accomplish?
>>
>>
>> Glenn Andreas <email_removed>
>> <http://www.gandreas.com/> oh my!
>> quadrium | build, mutate, evolve | images, textures, backgrounds, art
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Wed Apr 13 01:36:33 2005
That underline means that you're in the middle of an inline input
session. It doesn't necessarily imply double-byte input.
For example, the Korean input manager supports input either with or
without creating an inline input session. In either case, double-byte
characters are generated. Also, the Japanese input manager will input
Japanese text without starting an input session—for example, try
entering a space or a comma. (These do, in fact, generate non-ASCII
characters.)
I'm hard-pressed to think of a concrete example of a language that can
be represented in single-byte that can start an inline input session,
but there are isolated cases where it happens. Technically, halfwidth
Japanese Katakana can be represented in single-byte with SJIS, and can
be input via an inline input session, but that's sort of an edge case.
Basically, here's the real issue: "double-byte" as a concept is just a
complete anachronism nowadays. Everything is Unicode. Unicode can
represent characters as UTF16, where all characters are two bytes wide,
or as UTF8, where individual characters can be between 1 and 4 bytes
long. The idea of code pages is just behind us.
If what you really want to know is "is an inline input session active,"
I know how to do it in Carbon, but not Cocoa. I'm sure someone here can
enlighten you.
Keep in mind that the user can also input characters via other
means—drag-and-drop, Character Palette, paste, etc.—and could introduce
all sorts of non-ASCII text in those ways as well. What exactly are you
trying to do?
On Apr 12, 2005, at 4:26 PM, John Pattenden wrote:
> Well that's not strictly the case, when double byte characters are
> being input Cocoa goes into a special mode. You can tell this since
> the text has a line under it and is not officially "entered" until the
> user presses the enter key. So there is a difference on the input side
> for Double Byte characters - All I need to know is if that mode is
> active or not..
>
>
> John Pattenden
> ScreenTime Media
>
> Get Advice - Give Advice
> http://forums.screentime.com
>
>
>
> On Apr 12, 2005, at 6:57 PM, glenn andreas wrote:
>
>>
>> On Apr 12, 2005, at 5:41 PM, John Pattenden wrote:
>>
>>> Is there a way to determine if double byte text input is active?
>>>
>>> I need to make a special case for my code that does different things
>>> if regular text is being entered vs Japanese or some other Double
>>> Byte text.
>>> thanks for any help
>>>
>>
>> Given that Cocoa uses Unicode for it's user text input, there is no
>> such thing as "regular text" vs "double byte text" - you get an
>> NSString composed of unichars (disregarding, for the moment,
>> surrogate pairs), so your question doesn't really make sense from a
>> Cocoa point of view...
>>
>> What exactly are you trying to accomplish?
>>
>>
>> Glenn Andreas <email_removed>
>> <http://www.gandreas.com/> oh my!
>> quadrium | build, mutate, evolve | images, textures, backgrounds, art
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| John Pattenden | Apr 12, 22:10 | |
| John Pattenden | Apr 13, 00:41 | |
| glenn andreas | Apr 13, 00:57 | |
| John Pattenden | Apr 13, 01:26 | |
| Douglas Davidson | Apr 13, 01:32 | |
| John Stiles | Apr 13, 01:36 | |
| John Pattenden | Apr 13, 02:00 | |
| John Pattenden | Apr 13, 02:38 | |
| Ben Kennedy | Apr 13, 02:42 | |
| John Stiles | Apr 13, 02:45 | |
| Aki Inoue | Apr 13, 07:23 | |
| Aki Inoue | Apr 13, 07:27 |






Cocoa mail archive

