winforms - is there any way to define a char or a text is unicode or not in c#? -


i want make auxiliary software myself.
first software need know input text english or it's unicode text japanese or arabic or ... etc except english.
need know there way define char or text unicode or not in c#?
any tips appreciated.


-------------------------
update question ...
-------------------------
don't want use dictionary recognizing text's means. need define datatype between varchar , nvarchar sql server datatype . example if input in english characters a,b,c,...,z input varchar else nvarchar.

***my solution use switch case , search entire input text find character not in english ascii code if find letter, input type nvarchar


is right solution?

as matthew said, cannot built-in functions or method. however, if input text isn't big can iterate chars of word , find out if contains atleast single unicode character or not.

private bool isunicode(string text) {     char[] _chararray = text.tochararray();     bool _unicodeflag = false;      for(int _index=0; _index<_chararray.length-1 && !_unicodeflag; _index++)     {         if (((int)_chararray[_index]) > 255)             _unicodeflag = true;     }     return _unicodeflag; } 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -