C# Convert string from UTF-8 to ISO-8859-1 (Latin1) H
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have googled on this topic and I have looked at every answer, but I still don't get it. Basically I need to convert UTF-8 string to ISO-8859-1 and I do it using following code: Encoding iso = Encoding . GetEncoding ( "ISO-8859-1" ); Encoding utf8 = Encoding . UTF8 ; string msg = iso . GetString ( utf8 . GetBytes ( Message )); My source string is But unfortunately my result string becomes What I'm doing wrong here? 回答1: Use Encoding.Convert to adjust the byte array before attempting to decode it into your destination encoding.