正常转utf8
Dim file As String = "文件.txt"
Dim bytes() As Byte
Dim utf As Encoding = Encoding.GetEncoding("utf-8")
Dim def As Encoding = Encoding.Default
Bytes = def.GetBytes(file)
Bytes = Encoding.Convert(def, utf, Bytes)
file = def.GetString(Bytes)
Output.Show(file)
utf8转正常
Dim file As String = "鏂囦欢.txt"
Dim bytes() As Byte
Dim utf As Encoding = Encoding.GetEncoding("utf-8")
Dim def As Encoding = Encoding.Default
Bytes = utf.GetBytes(file)
Bytes = Encoding.Convert(utf, def, Bytes)
file = utf.GetString(Bytes)
Output.Show(file)