Bundy
Bundy

Reputation: 103

C# ASP.NET MVC resource file's string is in a strange encoding format in HTML source

Let's see an example: there is a German word: Fußgängerübergänge

What I have:

Question: what did I do wrong, how can I fix this "encoding" issue? What should I do if a want the last 2 words appear in the source code as same as the first two?

Upvotes: 7

Views: 4969

Answers (2)

Iam ck
Iam ck

Reputation: 11

This solution is working for me:

alert('@Html.Raw(Resource.ResourceManager.GetString("Contractcheckalert"))');

before

Before Fix

after

After the Fix

Upvotes: 0

Alan
Alan

Reputation: 3002

If you want to prevent your text from being HTML encoded, you can simply use Html.Raw:

@Html.Raw(Resources.MyResource.TestWord)

Is the encoding actually a problem, though?

Upvotes: 9

Related Questions