Character encoding html not showing correct output (Â)


I am using Spanish lanuguage on our .NET MVC website, when page is loading it is not showing correct character like changing "á" into "Â", something like below image

character-not-loading-correctly-utf-encoding-min.png

I am already using below HTML code for settings content type with "charset=UTF-8"

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

But it is not working, how can I resolve this?


Asked by:- bhanu
0
: 171 At:- 3/6/2021 8:24:59 AM
HTML html encoding charset-utf-8






1 Answers
profileImage Answered by:- vikas_jk

You need to change the encoding of file, to make sure the encoding on <meta> is the same like the file encoding.

To do this in Visual Studio 2017 or latest, simply open the file in Visual Studio, then select "File" -> "Save [Filname] as..." from there click the arrow next to "Save", as shown below

save-with-encoding-visual-studio.png

Now from "Advanced options" select "Unicode (UTF-8 with signature)"

save-unicode-utf-charset-min.png

Then Click "Ok" to save file, this should show correct output.

In Notepad++ or Sublime Editor (Solution for those who are not coding in .NET)

On Notepad++ select Encoding -> UTF-8 (without BOM) and save the file.

Also, use <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> tag inside HTML head tag.

1
At:- 3/6/2021 9:30:09 AM
I have already solved it using above approach, but excellent answer, was struggling from long time with this. 0
By : bhanu - at :- 3/23/2021 3:42:56 PM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly