0

One of my SQL like statement is breaking when user enters Chinese characters. I did some research and couldn't find any.

Is there any code available like a plugin or javascript function to validate and allow only english alphanumeric and allow special symbols.

If i validate Chinese characters there can be other languages right , so i thought to allow only english characters with all combination of numbers and symbols.

any direction or input will be appreciated thanks

I tried something like this but this allows only alphanumeric

/[^a-zA-Z 0-9]+/g
Evan Davis
  • 35,493
  • 6
  • 50
  • 57
kobe
  • 15,671
  • 15
  • 64
  • 91
  • Here you go; http://stackoverflow.com/questions/895659/how-do-i-block-or-restrict-special-characters-from-input-fields-with-jquery –  Apr 18 '13 at 14:18
  • 1
    What database server are you using and how is it breaking? It could be that you just need to change the collation on your database. – nullability Apr 18 '13 at 14:19
  • @nullability somewhere it is breaking , it need to debug more on that but thought i will ask here for suggestoins – kobe Apr 18 '13 at 14:27
  • @nullability you are right , its mysql – kobe Apr 20 '13 at 03:42

1 Answers1

8

How about UTF8 encoding the text rather than ban languages?

Xotic750
  • 22,914
  • 8
  • 57
  • 79