1

I have a question related to multi language website..

  • Added AddDefaultCharset utf-8 in .htaccess

  • Added this line <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> in every page

  • All pages changes to Unicode-UTF-8 from Western European using dreamweaver page properties

  • Database collation - utf8_general_ci

Russian, Japanese, Ukrainian, Chinese, Korean most of these languages and words are working properly except these word схожі-ігри

This word is ukrainian language - схожі-ігри . It stored into db table successfully and it also fetches the word properly. But, It doesn't work in url. When I go to this link www.mydomain.com/uk/схожі-ігри/ it says object not found.

But other href link ukrainian words are working properly except this one. Then I removed x from this word

сожі-ігри instead of схожі-ігри

This word сожі-ігри is working fine in url. But this is a wrong word. Last 3 hours I try to find the solution. I don't have any idea.

Karuppiah RK
  • 3,894
  • 9
  • 40
  • 80

1 Answers1

0

I used this :

function getDB() {
    global $dataBase;
    if($dataBase == null) {
        $dataBase = new DataBase();
    }
    $db = $dataBase->getConnection();


    //This are important things to query before you make any request from db...
    $db->query('set character_set_client=utf8');
    $db->query('set character_set_connection=utf8');
    $db->query('set character_set_results=utf8');
    $db->query('set character_set_server=utf8');
    return  $db;
}

Try it and tell me if it works...

V. Sambor
  • 12,361
  • 6
  • 46
  • 65
  • try to change connection query to 'utf8_general_ci' – V. Sambor Apr 24 '16 at 23:07
  • try to look also at utf8mb4 link here: https://mathiasbynens.be/notes/mysql-utf8mb4 – V. Sambor Apr 24 '16 at 23:11
  • have you tried setlocale(LC_ALL, 'fr_CA.utf-8'); or look here maybe you'll find something interesting about SET NAMES http://stackoverflow.com/questions/16092448/characters-not-displaying-correctly-on-a-utf-8-website – V. Sambor Apr 24 '16 at 23:18