you can check the encryption of the row that you want to save in the database by the entity, and then decide where you save it!
To deal with this problem, I suggest you use the Encoding.GetEncoding (String) method to do this.
Here is the function for you, and you can check it and let me know if it works.
public static bool IsUnicode(string input) { foreach (char chr in input) { string str = chr.ToString(); Encoding code = Encoding.GetEncoding("GB18030"); if (code.GetByteCount(str) == 2) { return false; } } return true; } And here is my test result: string zh = "微软"; string en = "Microsoft"; bool Izh = IsUnicode(zh);
To the method parameter, you can visit MSDN at http://msdn.microsoft.com/zh-cn/library/aa332097(VS.71).aspx to get the line you need.
Best regards, Nader SGHIR
source share