Check chines caracter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marcos

    Check chines caracter

    Hello,

    I want to check the caracters of one input box and validate if are in
    chines or not.

    Somebody help me?

    Thank' s

    Marcos

    --
    Usando o M2, revolucionário cliente de e-mail do Opera:
    Opera is a secure, innovative browser used by millions around the world with a built-in ad blocker, free VPN, units converter, social messengers, battery saver and much more - all for your best browsing experience. Download Opera browser now and enjoy the Internet once again. Want to know more? Visit opera.com and discover yourself.

  • Martin Honnen

    #2
    Re: Check chines caracter



    Marcos wrote:

    [color=blue]
    > I want to check the caracters of one input box and validate if are in
    > chines or not.[/color]

    JavaScript string processing is Unicode based (at least in browsers
    since IE4 and Netscape 4.06) thus you need to look at the Unicode
    specification to check which code points the chinese characters have and
    then check whether the characters in input.value are in that range, for
    instance with a regular expression.
    Depending on the encoding of your HTML/script you might need to use
    escape sequences alike
    '\uDDDD'
    to represent a character with Unicode code point DDDD.


    --

    Martin Honnen

    Comment

    Working...