I
Itsuo
Hi,
IE counts the number of characters based on UTF-16
regardless of page encoding. As a result, I am seeing the
unexpected result with surrogate characters. (a.k.a
supplement characters)
The issue is that IE counts one surrogate pair as 2 code
units and then it does not allow users to enter
characters up to the number of characters specified in
maxlength.
For example, if input field is defined as below, it is
supposed to be able to enter 10 code units based on the
page encoding, which would be UTF-8.
<input type="text" name="T1" size="20" maxlength="10">
However, when users enter surrogate characters, they can
only enter 5 characters since IE counts code points in
UTF16 instead of UTF8.
I think this is a bug in IE.
IE counts the number of characters based on UTF-16
regardless of page encoding. As a result, I am seeing the
unexpected result with surrogate characters. (a.k.a
supplement characters)
The issue is that IE counts one surrogate pair as 2 code
units and then it does not allow users to enter
characters up to the number of characters specified in
maxlength.
For example, if input field is defined as below, it is
supposed to be able to enter 10 code units based on the
page encoding, which would be UTF-8.
<input type="text" name="T1" size="20" maxlength="10">
However, when users enter surrogate characters, they can
only enter 5 characters since IE counts code points in
UTF16 instead of UTF8.
I think this is a bug in IE.