Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umlaute are wrongly encoded!

Tags:

c#

.net

encoding

I retrieve a stream. Everything works fine but the encoding of Umlaute (ä,ö,ü,ß).

What is

NäüßÖ´sas so viele Umlaute

becomes

NäüÃôsas so viele Umlaute

I tried Ascii-Encoding and a few other ones as the following source shows.

ASCIIEncoding encoder = new ASCIIEncoding();
Encoding enc = Encoding.GetEncoding(28591);

string response = enc.GetString(message, 0, bytesRead);

Which one will solve my problem?

like image 431
Hedge Avatar asked Feb 15 '26 11:02

Hedge


1 Answers

I don't know anything at all about .NET, but I do know that this pattern of mojibake:

äüÃÃÂ

is characteristic of UTF-8 being misinterpreted as ISO-8859-1. So try processing your input as UTF-8.

like image 151
zwol Avatar answered Feb 18 '26 02:02

zwol