Hello!
I created a blog but I have problem with Romanian characters: autobelgia.ro/article.php?id=7
Problem with diacritics
-
- Posts:39
Problem with diacritics
Admin
Posts:805
Hello
I see no problem with characters in that page. The romanian characters, diacritics, are displayed well.
Copied from that page:
1. MySQL database must be created with this setting: utf8_general_ci
2. The tables in MySQL must be created having this instruction: CHARACTER SET utf8 COLLATE utf8_general_ci
3a. When it is created the connection with MySQLi, you must add the setting for UTF-8:
3b. Or, if you use PDO:
4. In the php script you have to add header() function for UTF-8 (before displaying anything else, for example, after session_start()):
5. The HTML page must have in the <head> area:
- If you follow these steps, the script should register and display well the diacritics and other less usual characters.
I see no problem with characters in that page. The romanian characters, diacritics, are displayed well.
Copied from that page:
Anyway, if you have problems with diacritics or other less usual characters in your web page, follow these steps:mașină Începând cu data de 1 Mai 2016, Belgia a trecut la adoptarea placilor de tranzit în format european. Instituția
1. MySQL database must be created with this setting: utf8_general_ci
2. The tables in MySQL must be created having this instruction: CHARACTER SET utf8 COLLATE utf8_general_ci
3a. When it is created the connection with MySQLi, you must add the setting for UTF-8:
Code: Select all
$conn = new mysqli($host, $user, $password, $db_name);
$conn->query('SET character_set_client="utf8",character_set_connection="utf8",character_set_results="utf8";');
Code: Select all
$conn = new PDO('mysql:host='. $host .'; dbname='. $db_name, $user, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$conn->exec('SET character_set_client="utf8",character_set_connection="utf8",character_set_results="utf8";');
Code: Select all
header('Content-type: text/html; charset=utf-8');
Code: Select all
<meta charset="utf-8" />