Question

I thought this was something easy to Google, but the answers I found, did not fix my problem

In Chrome my RSS feeds are looking like this

"¿Qué es un serum antimanchas?" 

But all the rest characters are ok ..

In Safari, is the opposite. This line looks fine, but the rest of characters are wrong... and they look like

Espect�culo

I have this on my header which is supposed to work, can't find the problem,

<!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" xml:lang="es" lang="es">
<head>

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

NOTE: All files are saved with encode for UTF8 in sublime editor.

Was it helpful?

Solution

What you see in Chrome is UTF-8 encoded data misinterpreted as ISO-8859-1 or windows-1252 encoded. For example, U+00BF “¿” is 0xC2 0xBF in UTF-8. Treating that as ISO-8859-1 data, you get U+00C2 “” U+00BF “¿”.

From the given data, it is impossible to say what goes wrong. My guess is that the data is sent with an HTTP Content-Type header that declares the encoding as ISO-8859-1. The URL would be needed to verify this hypothesis.

The character “�” indicates a data error at the character level: the data contains a byte that does not denote any character, or part of a multi-byte representation of a character, in the character encoding being applied. This is most often encountered when ISO-8859-1 is being misinterpreted as UTF-8 encoded.

It seems that the data contains a mix of UTF-8 encoded data and ISO-8859-1 encoded data. The fix is to modify the system so that it consistently uses UTF-8 throughout, or at least converts everything to UTF-8 when data is being composed to be sent to a user agent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top