Dieter Müller
Dieter Müller

Reputation: 111

Ä is shown in string as <?>

I get the html-content and show it in a TextBox, but the "ä" is a <?>. It's like Windows doesn't get the ä...

I get the Htmlcontent like this:

public async Task<string> MakeWebRequest()
{
    HttpClient http = new HttpClient();
    HttpResponseMessage response = await http.GetAsync("***URL***");
    return await response.Content.ReadAsStringAsync();
}

How can I get a match in regex to the ä, which Looks like an "?" ?

Upvotes: 0

Views: 323

Answers (1)

Margus
Margus

Reputation: 20038

Something in the lines of:

using (var client = Connector.GetHttpClient())
{
    var response = await client.GetByteArrayAsync(url);
    data = Encoding.UTF8.GetString(response);
}

Upvotes: 1

Related Questions