Decoding an UTF-8 string to Windows-1256
问题 I used this code to encode a UTF-8 string to Windows-1256 string: string q = textBox1.Text; UTF7Encoding utf = new UTF7Encoding(); byte[] winByte = Encoding.GetEncoding(1256).GetBytes(q); string result = utf.GetString(winByte); This code is working but I can't decode the result or encoded to original string! How I can decode an encoded string (result variable) to same before converted (q variable)? 回答1: You are converting the strings incorrectly. Have a look at the commented code below. The