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.
有什么方法可以使用 VB.net 检查字符串是否为 UNICODE。
最好的问候 inchikka
您需要使用Encoding写入文件的 读取文件。
Encoding
它似乎是您尝试将其读取为 Unicode 的非 Unicode 文件,或者可能是与默认 UTF-8 不同的 Unicode 编码(例如,可能是 UTF-16)。
StreamWriter有几个Encoding作为参数的构造函数。
StreamWriter
您可以通过对照 ASCII 表中的 128 个字符验证字符串中的每个字符来做到这一点。如果在那里找不到该字符,则它可能是一个 unicode 字符。
你是这个意思吗?