• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

How can you parse non-ascii text in Javascript?

Hi,
How can you parse non-ascii text in Javascript? If I want to parse Chinese characters in Javascript using regular expression. Is this possible?

Thanks
Jamie
0
jamie_lynn
Asked:
jamie_lynn
  • 3
1 Solution
 
b0lsc0ttIT ManagerCommented:
Yes, it is possible.  The regex engine Javascript uses will support this.  The most common method is to have the expression use a unicode value.  In regular expressions this is done with ...

\uNNNN (where NNNN is the four digit unicode value)

Let me know if you have a question or need more info on this.

bol
0
 
b0lsc0ttIT ManagerCommented:
There is some good info on using unicode in an expression at http://www.regular-expressions.info/unicode.html.

I can provide more info or answer questions about this if needed.

bol
0
 
b0lsc0ttIT ManagerCommented:
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now