Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML file issue 'è' being turned into a strange character

Tags:

html

I'm getting started with html,however the following script doesn't do what it's supposed to:

<h1>Ciao Mondo!</h1>
<p>Questa è la nostra prima pagina HTML!</p>

The result produced in my browser changes the è to è :

Ciao Mondo!

Questa è la nostra prima pagina HTML!

like image 745
Antonio Pavan Avatar asked Dec 05 '25 14:12

Antonio Pavan


2 Answers

Insert this tag inside the head section of your html and see what happens:

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

With this you are instructing the browser how to deal with the special characters of Italian language.

Ciao Antonio!

like image 68
statosdotcom Avatar answered Dec 07 '25 04:12

statosdotcom


The HTML5 way, using the meta charset attribute. The lang attribute does not affect encoding, it is just there to aid screen-readers and search engines.

<!DOCTYPE html>
<html lang="it">
<head>
	<meta charset="utf-8">
</head>
<h1>Ciao Mondo!</h1>
<p>Questa è la nostra prima pagina HTML!</p>
</html>
like image 43
visibleman Avatar answered Dec 07 '25 04:12

visibleman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!