Author Topic: UIInput problem on Korean character.  (Read 4825 times)

bitwise

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 6
    • View Profile
UIInput problem on Korean character.
« on: February 23, 2014, 09:02:30 PM »
Hello,

I've updated NGUI from 3.0.9f7 to 3.5.1.
After update, I cannot input korean character more than a character.
 
I found below IF condition in UILabel.cs

  1. // There seems to be an inconsistency between IME on Windows, and IME on OSX.
  2. // On Windows, Input.inputString is always empty while IME is active. On the OSX it is not.
  3. if (string.IsNullOrEmpty(ime) && !string.IsNullOrEmpty(Input.inputString))

I examined Input variables, I typef 4 keys in sequence, 'ㄱ', 'ㅏ', 'ㄴ', 'ㅏ'

UIInput.text -> Input.compositionString : Input.inputString
'ㄱ' -> "ㄱ" : "" --- typed 'ㄱ'
'가' -> "가" : "" --- typed 'ㅏ'
'간' -> "간" : "" --- typed 'ㄴ'
'나' (wrong! '가나' is right) -> "나" : "가" --- typed 'ㅏ'

There is a case Input.compositionString != null && Input.inputString != null.
So I removed ime condition.

  1. // There seems to be an inconsistency between IME on Windows, and IME on OSX.
  2. // On Windows, Input.inputString is always empty while IME is active. On the OSX it is not.
  3. if (!string.IsNullOrEmpty(Input.inputString))
  4.  

It works. I don't know any side effects on this change.

Thanks.
« Last Edit: February 23, 2014, 10:58:05 PM by bitwise »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UIInput problem on Korean character.
« Reply #1 on: February 24, 2014, 02:05:37 PM »
Likely breaks OSX, as the comment states. There is an inconsistency in Unity (basically a bug).