fancyInput icon indicating copy to clipboard operation
fancyInput copied to clipboard

Not able to input Chinese or Japanese characters

Open AlloVince opened this issue 11 years ago • 14 comments

AlloVince avatar Feb 25 '13 02:02 AlloVince

will look into that, thanks

yairEO avatar Feb 25 '13 02:02 yairEO

I don't know how to test this. if i copy/paste Chinese letters it seems to work, but i don't know how to input them myself..i don't know what the hell is going on with windows7.. I've changed the language to Chinese and it prints out english letters..so does Japanese..I don't know

yairEO avatar Feb 25 '13 02:02 yairEO

I think you could install a Google Japanese input to test:

https://tools.google.com/dlpage/japaneseinput/eula.html?platform=win&hl=en

After installed, you could click the "A" icon in your taskbar, and change it to hiragana, then you could typing Japanese characters

AlloVince avatar Feb 25 '13 03:02 AlloVince

I can confirm that Japanese characters won't input — OS X 10.8.2 (Kotoeri) using Chrome 25.0.1364.99 beta. As you said, yairEO, pasting works just fine, but typing fails to display anything but perhaps a small blank space.

You don't necessarily need Google's IME, Windows comes with the ability to enable Japanese/Chinese IMEs: http://www.localizingjapan.com/blog/2011/01/20/japanese-input-on-windows-7/

Oh, and as for typing Japanese characters: Make sure you've turned it to Hiragana/あ (half- or full-width characters, doesn't matter) and that you type things that are actually words... like nihongo wo dekimasu!, which should convert to 日本語をできます! or similar when you hit the space or enter keys.

friedbunny avatar Feb 25 '13 04:02 friedbunny

It seems this bug has to do with the IME not reporting a real character code, so there's nothing to convert and add to the display element. When you're typing in Japanese, the IME reports key code 229 and inserts characters on keydown, then converts them (if it can) to a Japanese character on keyup.

Example:

Type "h" — keydown and keyup both see "h"

Continue typing an "a" — keydown sees "ha" for the entire input and "a" for this character, but keyup sees the converted "は" for both

Hit space — on keyup, the IME further converts to kanji character(s), in this case typically "葉"

Hit enter — the IME finalizes the selection and we're done

... which means one possible solution would be to check if the key code is 229, insert new characters on keydown, and check to see if they've changed on keyup. But you'll probably have to check the raw ("shadow"?) input to see exactly what has changed, because converted character counts will often differ ("nihongo" → "にほんご" → "日本語").

friedbunny avatar Feb 25 '13 08:02 friedbunny

Maybe it's related so I'll post here. I can't use Polish national chars on Chrome (24.0.1312.57 m). Actually I can, but they don't appear.

It's working fine on Firefox.

http://screencast.com/t/crMUvWvG

radmen avatar Feb 25 '13 13:02 radmen

do you use MAC or WINDOWS? if windows, do you use a normal windows keyboard for the problematic language?

yairEO avatar Feb 25 '13 18:02 yairEO

I'm on Windows (7 Pro). My keyboard is set to polish-programmer it's a standard keyboard layout.

radmen avatar Feb 25 '13 18:02 radmen

Cannot type in Chinese from my OS X mountain lion too, with Safari.

pzgz avatar Mar 01 '13 03:03 pzgz

can you please debug this and push a fix? I have no MAC, no OSX and no Chinese...

yairEO avatar Mar 01 '13 17:03 yairEO

@friedbunny, @AlloVince, @pzgz, @radmen and anyone else looking to use fancyInput with Japanese/Chinese/Korean input, I've added support on my fork: https://github.com/vaicine/fancyInput

Feel free to add any issues you find while using it.

vaicine avatar Oct 09 '13 21:10 vaicine

@vaicine I tried the new fork demo, but it still not able to input Chinese characters. Under win7sp1, firefox 24, with google chinese input.

AlloVince avatar Oct 10 '13 01:10 AlloVince

Ditto—new fork still doesn't handle Japanese character conversion (roman-kanji or kana-kanji) on iOS 6, Safari or Chrome. Thanks for the effort, though!

friedbunny avatar Oct 10 '13 01:10 friedbunny

@AlloVince thanks for trying it out - I tried it out under win7 with firefox and you're right, it's not working. Looks like firefox isn't sending the keycode 229 like chrome is. I could only get it to work on chrome.

@friedbunny I have used my fork here: http://kana.vaicine.com and this works for me under win7 chrome and OSX chrome. I also found it doesn't work on Android chrome as well as ios7 safari.

I'll investigate whether it's at all possible on those browsers, and hopefully come up with a solution.

vaicine avatar Oct 10 '13 08:10 vaicine