Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想检索给定字符的 ANSI 代码值。例如,当我现在得到商标字符的 int 值时,我得到 8482。相反,我想得到 153,这是代码页 1252 中商标字符的值。
一些帮助将不胜感激。
于尔根
自己找到的:
Encoding ansiEncoding = Encoding.GetEncoding(1252); byte[] bytes = ansiEncoding.GetBytes(c); int code = bytes[0];