I know it's kinda popular question, but still I didn't find any solution.
So I am getting the xml file as the response from api, but Cyrillic symbols represents as question marks.
I have tried to convert source array of bytes using Encoding
class.
using (var httpClient = new HttpClient())
{
var response = await httpClient.GetAsync(uriBuilder.Uri);
var responseBytes = await response.Content.ReadAsByteArrayAsync();
var responseText = Encoding.UTF7.GetString(responseBytes);
var utf8 = Encoding.UTF8.GetString(responseBytes);
var unicode = Encoding.Unicode.GetString(responseBytes);
var ascii = Encoding.ASCII.GetString(responseBytes);
var defaultt = Encoding.Default.GetString(responseBytes);
}
But still there is no luck.
Charset in response:
Content-Type: text/xml;charset=windows-1251;
Could anyone suggest any solutions please ?
Update: the answer is my comment below