0

hi,

I have a simple website having russian content, but its not displaying right in website. I am using even following meta tags

<html lang="ru">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="content-language" content="ru">

But still question marks are there. Please help me regarding this issue

thanks in advance

3
Contributors
9
Replies
12
Views
7 Years
Discussion Span
Last Post by BzzBee
0

Can you give us some examples of the characters you're trying to display? Try:

<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
0

Yes i am using this as well. here is my website please check and see its view sourse

http://www.moraira-invest.ru/

These type of characters i am using.

Итак, слева расположены кадры из "Меча

I had tried these characters just at simple html page with nothing else, then it works fine but as i am going at my actual site it convert all the text in question marks, i do not understand why its doing this.

0

So the windows-1251 didn't work?? Every russian site i've been to has this character encoding! Look here:
http://winrus.com/cpage_e.htm

"Most Russian-language Web pages (more than 90% for sure) are made nowadays in Windows-1251 encoding a.k.a. "Cyrillic(Windows)", just because the majority of authors work under MS Windows nowadays and 1251 is what Microsoft uses for Cyrillic, so built-in Windows Cyrillic fonts and keyboard tools are for Windows-1251 encoding."

0

thanks for the help nonshatter

I have read all these kind of stuff. and it works fine if i use plain html page with just text. But when i use .php file and including different files in main file and my data is coming from database then it all goes wrong. :(

0

When I view your site, I see two different content-type meta tags:

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Морайра Инвест - недвижимость в испании - Buy, Sell, Resa</title>
  <meta http-equiv="content-type" content="text/html;charset=utf-8">
  <meta http-equiv="content-language" content="ru">
  ...
</head>

You should only have 1 and you probably want to be using UTF-8 as this should contain the character sets you want to be working with.

http://www.phpwact.org/php/i18n/charsets
http://www.phpwact.org/php/i18n/utf-8
The first covers a great overview of the implications of characters sets in php and the second has a very detailed breakdown of many string functions and their risk level in terms of UTF-8 corruption.

This boils down to your outputted html needs to have a proper content-type meta tag and your application needs to send a proper content-type header and they should match.

Beyond what the articles mentions, your database connection needs to be set to the proper character set.
-MySQL Extension
http://www.php.net/manual/en/function.mysql-set-charset.php

-MySQLi Extension
http://php.net/manual/en/mysqli.set-charset.php

-PDO Extension
http://www.galengrover.com/web-development/setting-the-connection-charset-with-php-mysql/

Within your database you also need to set the proper character set and collation
http://dev.mysql.com/doc/refman/5.0/en/charset-database.html
Your tables will also have similar settings.

Hopefully this helps and gets you pointed in the right direction. Iñtërnâtiônàlizætiøn in php can be a real pain.

0

Thanks for the help. But now i had resolved the issue by using hexadecimal codes. I tired every option but that was not working accurately thats why now i am using hexadecimal characters for russian text.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.