Reputation: 31
I am working on a multilingual website. I use a database and a table to get the translations for the different words and sentences.
For instance, in my menu I have an element called "Translations". So when the website is visited in German....the element will be called "Übersetzungen"
Now here comes the problem. For the rest of the special characters this problem doesn't happen. It seems to happen only with uppercase special characters like "Ü".
In the table of the database the value is "Ãbersetzungen" and in HTML printed should be "Übersetzungen".
In other cases like "Länder" (countries in German), the translation returns "Länder". (contains an lowercase special character).
The UT8 is set in the header, the data is correctly inserted in the table and in all cases which contains UT8 special characters works fine, except special uppercase characters.
I am using WAMP to build my website and the php.ini has utf8 as default.
What could be the problem?
Upvotes: 0
Views: 2361
Reputation: 183
Try this..
https://www.php.net/manual/en/function.mb-strtoupper.php
<?php
$str = "Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός";
$str = mb_strtoupper($str, 'UTF-8');
echo $str; // Prints ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ
?>
Upvotes: 1