Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: bitwise on February 23, 2014, 09:02:30 PM

Title: UIInput problem on Korean character.
Post by: bitwise 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.
Title: Re: UIInput problem on Korean character.
Post by: ArenMook on February 24, 2014, 02:05:37 PM
Likely breaks OSX, as the comment states. There is an inconsistency in Unity (basically a bug).