I have an ASP.NET page that shows stuff (data in tables), does stuff (modifies data) and sometimes sends email about these. It used to work without problems, but recently something broke with the encoding.
The site uses hungarian characters like 'Á', 'Ú' or 'Ő', etc, but this was never a problem before, it displayed them correctly. But recently the emails it sends arrive looking like this:
Sérült tétel státusz változás
Instead of looking like this, as it should:
Sérült tétel státusz változás
The problem is not only with the emails, but sometimes with label texts as well. For example, using this:
Label.Text = "Saját jegyzőkönyveim"
Results in the label showing as:
Saját jegyzőkönyveim
But this only seems to be an issue if label text is set in code-behind. If the label text is set in the .aspx file, then it displays fine. The text content of the emails are also set in the code behind, so I believe the issue must be with the encoding with the .cs file. A while ago I even remember Visual Studio complaining something about the encoding of the files when I saved them once, but I don't remember what it was complaining about. But anyway, I believe it somehow set it to a different encoding or something. It's probably related to a single file, as our other pages still send emails correctly, even though they run under the same web.config, etc.
So what might be the issue? Trying Save As and change encoding there it's already set at UTF-8, so where else might it be changed that causes this? Any help is appreciated, thanks in advance!
Case solved. Turns out the .cs file was encoded in "UTF-8 without signature", while it was supposed to be "UTF-8 with signature".