我有编码和解码日文字符的要求。我尝试在JAVA和它与“Cp939”编码正常工作,但我无法在.NET中找到该编码。 932编码不会对所有字符进行编码,所以我需要找到一种在.NET中实现939编码的方法。.NET中的编码问题
Java代码:
convStr = new String(str8859_1.getBytes("Cp037"), "Cp939");
.NET:
bytesConverted = Encoding.Convert(Encoding.GetEncoding(37),
Encoding.GetEncoding(932), bytesConverted);
// This result is a junk of characters and is totally different
// from the expected output 'ニツポンバ'
convStr = Encoding.GetEncoding(1252).GetString(bytesConverted);
如果我给Encoding.GetEncoding(939),它会引发错误,指出 '不支持的编码'。所以不能在939编码。 –