Hi,
In one of my application I'm using IBM MQ for request/ response everything working fine until I receive response in
Thai characters which received/ shown as garbage (lost characters)
"I'm writing response to a file using UTF-8 encoding". when I open response and apply
Thai character set to the response file in Notepad++ it shows correct value.
Below is the response I received-
<Name1>กลุ่ม</Name1>
For Now I'm writing the response to temporary file on drive and reading that response using encoding as below it works-
Encoding encd = Encoding.GetEncoding(874);
System.IO.File.WriteAllText("D:\\temp_1.txt", _response);
string s = System.IO.File.ReadAllText("D:\\temp_1.txt", encd);
Same I'm trying to achive using string it doesn't work
byte[] data = System.Text.Encoding.Unicode.GetBytes(_response);
string xyz = encd.GetString(data);
oLogger.LogDebugMessage("Response encd: " + xyz);
I dont want to write response to file and read through this doesn't seem feasible. Can anyone suggest anything using string encoding?
What I have tried:
I've tried converting response in string to unicode
<pre>byte[] data = System.Text.Encoding.Unicode.GetBytes(_response);
string xyz = encd.GetString(data);
oLogger.LogDebugMessage("Response encd: " + xyz);