Search Unity

[WebGL] Unable to input Traditional Chinese character?

Discussion in 'Web' started by austom832000, Aug 11, 2015.

  1. austom832000

    austom832000

    Joined:
    Oct 30, 2012
    Posts:
    5
    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...
     

    Attached Files:

  2. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
    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 : http://dragonfly.com.ua/webGlTesting/
    And I was including : Inc. Font Data for the fonts.
    ---
    instead of Russian letters I see rubbish
     
    Last edited: Aug 11, 2015
  3. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
  4. austom832000

    austom832000

    Joined:
    Oct 30, 2012
    Posts:
    5
    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
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    @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?
     
    austom832000 likes this.
  6. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
  8. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
    Jonas, nave any news?
    I was trying:
    Code (CSharp):
    1. System.Text.UTF8Encoding _encodingUnicode = new System.Text.UTF8Encoding();
    2. byte[] cyrillicTextByte = _encodingUnicode.GetBytes(str);
    3. 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/):
    Code (CSharp):
    1. void LateUpdate() {
    2.         if(Input.anyKeyDown)
    3.             Debug.Log("Input.inputString = " + Input.inputString);
    4.     }
     
  9. dm_bond

    dm_bond

    Joined:
    Sep 19, 2011
    Posts:
    62
    Bug (719326) still exist in 5.2.1f1. What need for fix: just time, new bugreport?
     
  10. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
    yes, yes,, bug still there, maybe try to update a bug report(add something)
     
  11. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    197
    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
    --------
     
  12. Ameyoru

    Ameyoru

    Joined:
    Jan 6, 2016
    Posts:
    2
    Will the IME input be fixed at the future?
     
  13. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Are you seeing any problem with Unity 5.3 ?
     
  14. Ameyoru

    Ameyoru

    Joined:
    Jan 6, 2016
    Posts:
    2
    Yes, I cannot switch IME with 5.3.1f1 and can't type any chinese in input fields.
     
  15. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Are you using your own fonts in the input field ?
     
  16. kotsopoulos

    kotsopoulos

    Joined:
    Nov 6, 2014
    Posts:
    22
    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:
    http://forum.unity3d.com/threads/japanese-hiragana-characters-dont-work-in-webgl.356097/
     
    Last edited: Jan 8, 2016
  17. Nemo1991

    Nemo1991

    Joined:
    May 10, 2016
    Posts:
    3
    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.)
     
  18. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    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: https://www.assetstore.unity3d.com/en/#!/content/64933
     
  19. Nemo1991

    Nemo1991

    Joined:
    May 10, 2016
    Posts:
    3
    @jonas-echterhoff 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.
     
  20. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    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.