omega
omega

Reputation: 43843

How to fix character encoding issue in html?

I have a web page, and if I open it in windows notepad, a piece of text looks like this

Avertissement sur la sécurité

But if I open it in notepad++, it looks like

enter image description here

Notepad++ also says the file is in utf-8 encoding too.

If I open it in a browser, it looks like

enter image description here

I have

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

Does anyone know how I can fix this?

Thanks

Upvotes: 4

Views: 11595

Answers (1)

Sebastian Brosch
Sebastian Brosch

Reputation: 43574

You have to make sure the encoding on <meta> is the same like the file encoding (on Notepad++).

You want to use UTF-8?

  • On Notepad++ select Encoding -> UTF-8 (without BOM) and save the file.
  • Use <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

You want to use ISO-8859-15?

  • On Notepad++ select Encoding -> ISO-8859-15 and save the file.
  • Use <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">

Upvotes: 6

Related Questions