Characters changed

S

shapper

Hello,

I have an image which alt attribute is "à educação".

When I preview the web site it becomes "à educação"

I have the following on my head:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
What am I doing wrong?

Thanks,
Miguel
 
M

Mayeul

shapper a écrit :
Hello,

I have an image which alt attribute is "à educação".

When I preview the web site it becomes "à educação"

I have the following on my head:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

What am I doing wrong?

Thanks,
Miguel

If your page is served from the web it doesn't matter what you put in
your <meta http-equiv="Content-Type">.

The browser will override it with whatever the http header Content-Type
indicates.

Solution: ensure the document is served with a "Content-Type: text/html;
charset=utf-8" http header.
 
J

Jukka K. Korpela

Mayeul said:
If your page is served from the web it doesn't matter what you put in
your <meta http-equiv="Content-Type">.

It surely matters, if the server does not specify Content-Type.
The browser will override it with whatever the http header
Content-Type indicates.

Yes, _if_ such a header is sent.
Solution: ensure the document is served with a "Content-Type:
text/html; charset=utf-8" http header.

In the absence of a URL, we cannot possibly know what that would fix the
problem or make it worse. If the data is actually ISO-8859-1 or Windows-1252
encoded, for example, it does no good to declare even at the HTTP level that
it is UTF-8.

The crucial question is what the encoding of the page really is. The URL
would tell that, among other things.
 
M

Mayeul

Jukka K. Korpela a écrit :
It surely matters, if the server does not specify Content-Type.


Yes, _if_ such a header is sent.


In the absence of a URL, we cannot possibly know what that would fix the
problem or make it worse. If the data is actually ISO-8859-1 or
Windows-1252 encoded, for example, it does no good to declare even at
the HTTP level that it is UTF-8.

The crucial question is what the encoding of the page really is. The URL
would tell that, among other things.

Indeed I assumed too much. Thanks for the correction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top