How to recognize code page of input string, for example if I put something in Cyrillic it should return windows-1251 and when I put string in Chinese it return other code page etc
+1
A:
If this is an input from a textbox (windows forms) the string is a .Net string, and is always in unicode (UTF-16).
If you get the input from a Web form (aspx) page, the browser also sends the codepage with it. And .Net will make it unicode for you.
If you get the input from a file, I wish you good luck ;-).
GvS
2010-07-28 08:32:09