tony wong wrote:
is it possible to detect any double-byte character in the text? thanks.
Since JavaScript 1.3 (in Netscape 4.06) and JScript 4 (in IE 4) the
strings in JavaScript are sequences of Unicode characters, you can
access any character in a string with
string.charAt(index)
and the Unicode character code of any character in a string with
string.charCodeAt(index)
There is no byte type in JavaScript 1.x and there is no access to the
internal byte representation of an Unicode character or a complete string.
The internal string representation choosen is usually UTF-16 so in that
sense all characters are double byte characters. But as said, as a
scripter you deal with sequences of Unicode characters and the internal
encoding in bytes does not matter for scripting.
--
Martin Honnen
http://JavaScript.FAQTs.com/