-2

I have a french website, the below is my header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

I am trying to put these charactors ù,é it turns in to �

Please tell me why?

Thank you.

Vish K
  • 127
  • 1
  • 2
  • 11

3 Answers3

2

I am trying to put these charactors ù,é it turns in to �

That is a pretty certain indicator that the text you output is not UTF-8 encoded as you say in the header. My guess would be it's ISO-8859-1 encoded.

This can be because

  • The HTML file you are editing isn't UTF-8 encoded. Save it as UTF-8 - the option for that is often in the "Save As..." dialog of your editor or IDE.

  • The database connection you are getting the text from isn't UTF-8 encoded.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1

You can use the following code in head section

<meta http-equiv="encoding" content="text/html" />

I think it will works for you.

Vishal Purohit
  • 261
  • 2
  • 12
1

You need to save the html file as UTF-8 format. Also you can add an attribute lang="fr" to your html tag.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Arafangion
  • 11,517
  • 1
  • 40
  • 72
defau1t
  • 10,593
  • 2
  • 35
  • 47