[WebGL] Unable to input Traditional Chinese character?

Hi All:
I am trying to input some chinese characters on the InputField. The chinese font (kaiu) was assigned to Placeholder and Text correctly. And I changed the text of the Placeholder’s component to “請輸入文字…”

When I use firefox browser to open the web gl build. It looked well until i want to type some chinese characters on the InputField. I can only type English character and windows 8.1 tipped me the IME stop working. Is any thing wrong? thanks a lot…

on standard uGUI, u can set a font properties: Custom Chars and add symbols. But guys, on NGUI it’s not working. I have problem with Cyrillic on the InputField : Паркова сторінка Imena.UA
And I was including : Inc. Font Data for the fonts.

instead of Russian letters I see rubbish

root of the problem is in Input.inputString… where is my Cyrillic -?

I am including Inc. Font Data for the fonts too…

It seems strange that the input font works well on the Editor, but not on WEB GL build

@austom832000 : IME input will not currently work in WebGL input fields. This is not something we can really fix right now, because browsers will not send the necessary events we’d need to process IME input. A possible workaround is to use an html text field.

@yuliyF : Russian is different, it is not IME and should work. Did you file a bug with your repro case and project folder, so we will look at it?

1 Like

@yuliyF : Russian is different, it is not IME and should work. Did you file a bug with your repro case and project folder, so we will look at it?[/QUOTE]
I was reporting a bug(include my project), looks: 719326( http://fogbugz.unity3d.com/default.asp?719326_5tup7fes5n4u1loj )

I was reporting a bug(include my project), looks: 719326( http://fogbugz.unity3d.com/default.asp?719326_5tup7fes5n4u1loj )[/QUOTE]

Thanks, I asked QA to look and verify!

Jonas, nave any news?
I was trying:

System.Text.UTF8Encoding _encodingUnicode = new System.Text.UTF8Encoding();
byte[] cyrillicTextByte = _encodingUnicode.GetBytes(str);
inputTest.value = _encodingUnicode.GetString(cyrillicTextByte);

it’s not helped
Instead a Cyrillic letter I see a rubbish
Just looks in a web console (http://dragonfly.com.ua/webGlTesting/):

void LateUpdate() {
        if(Input.anyKeyDown)
            Debug.Log("Input.inputString = " + Input.inputString);
    }

Bug (719326) still exist in 5.2.1f1. What need for fix: just time, new bugreport?

yes, yes, bug still there, maybe try to update a bug report(add something)

You don’t believe.. I can’t believe in it, today I get a message from bugs@unity3d.com :

Hello again,

now we finally got the issue. Thanks again for the extra info. Will forward it to the developers.

Regards,
Stefan

Will the IME input be fixed at the future?

Are you seeing any problem with Unity 5.3 ?

Yes, I cannot switch IME with 5.3.1f1 and can’t type any chinese in input fields.

Are you using your own fonts in the input field ?

We have exactly the same problem with input field. Only english are supported. Greek and Polish characters are received but not dispayed. You can understand it pressing backspace after input. Characters are there but not rendered. And if i try to copy the text and use a specified asset from the store (TextMeshPRO) i have the characters all rendered nicely in the asset component. I use unity 5.3.1 . Any ideas ??

EDIT:

By the way this happens only when i export for webgl. But if i am on the editor the text is rendered with no problems at all. I am using my own fonts in the input field that are verified as supporting the languages i mentioned. And i use the very same fonts to generate the appropriate SDF (a scriptable object file that is used by text mesh pro) font atlas and it works.

SOLUTION:
Arial shipping with Unity WebGL supports only Latin. We changed with an Arial font file with all the required fonts included and works fine. We found the solution here:

Hey any updates with IME on WebGL?
We are building with unity version 5.3.5p1 and still the IME (on japanese language) is disabled when focus in on the player canvas. We are trying to push the game to Japanese audience and without IME it is impossible. (we have an in-game chat and places where you need to type your name etc.)

OS supported IME Input is not possible in Unity WebGL today, because the browsers don’t expose the events we would need to do so. The only technical option for us to “fix that” would be to write our own IME inside JavaScript (or inside Unity), but it would deliver an inconsistent experience with native OS level IME.

Currently, the only workaround is to use html text fields for your IME text input needs. This may help: Unity Asset Store - The Best Assets for Game Making

@jonas-echterhoff_1 thanks for the quick response as time is at the essence in our case. We will do the workaround then, but it would be great to have this feature in the future (rhyme not intended). Is keeping these events from JS a security issue for browsers? Maybe a request for those events to be exposed is in order? Thanks anyway.

I don’t think it is a security issue. Rather it is an issue of “nobody has bothered to solve it yet”. And I don’t expect a solution to come fast - as browsers will first need to agree on a specification to use. And so far, this problem is rather a niche case, unfortunately - for most web input needs, html text fields are just fine. There are not many use cases yet (outside of unity) for building custom text input fields in javascript.

1 Like