Different language on the site

I am trying to write a website in the Slovak language (central Europe). What I did is put these two meta tags in the title:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta http-equiv="Content-Language" content="sk" />

      

The problem is that all accented characters are replaced with garbage characters (so I don't work with encoding explicitly). What to do?

Here is the top of the page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sk" lang="sk">
<head>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="sk" />

      

+2


source to share


2 answers


When you save the file, you must make sure that it is created with the same encoding you specified in the meta tag.



I recommend using utf-8 instead of iso-8859-2. The Unicode character set supports all characters in almost every existing language (and even some that don't ...).

+5


source


There are two problems here.

  • Tongue
  • Character encoding

Tongue

Content-Language The HTTP header describes the natural language of the target audience. It may not be the same as the language in which the document is written. Use the lang attribute to describe this.

Character encoding

This allows you to represent the letters you want to use. You need to make sure that your text is indeed using the encoding of your choice and that the browser is told that this is the encoding you are using.



HTTP headers

NB : it is mentioned in your question <meta http-equiv>

. Real HTTP headers are the best place to put this information, and they will override anything your document claims. Make sure your server is configured correctly.

XHTML

XHTML complicates matters ...

+5


source







All Articles