By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

How to determinate if a stirng is Chinese or English

P: n/a
ad
I use a TextBox for to enter an string.
How can I determiniate if the stirng is Chinese or English?
Oct 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ad <fl****@wfes.tcc.edu.twwrote:
I use a TextBox for to enter an string.
How can I determiniate if the stirng is Chinese or English?
Well, you could check if every character is ASCII (i.e. has a Unicode
value < 128). If so, it can't be Chinese. On the other hand, that won't
catch words with accents in. What would you want to happen if someone
entered half a Chinese word and half an English word?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 25 '06 #2

P: n/a
Im guessing you have to change the settings on the PC to enter chinese
characters?

If so you can use the

System.Globalization.CultureInfo.CurrentCulture

property to get the culture which the current thread is using

ad wrote:
I use a TextBox for to enter an string.
How can I determiniate if the stirng is Chinese or English?
Oct 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.