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
I am already using below HTML code for settings content type with "
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
But it is not working, how can I resolve this?
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
Now from "Advanced options" select "Unicode (UTF-8 with signature)"
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.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> tag inside HTML head tag.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly