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

Recommended Answers

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" />
Jump to Post

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 …

Jump to Post

Ahhh... could it be the character encoding of your database?! Check this

Jump to Post

All 9 Replies

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" />

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.

Please Help Me.

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."

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. :(

Ahhh... could it be the character encoding of your database?! Check this

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.

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.

thanks to all of you for your help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.