I've got the following problem with m开发者_开发问答y PMA-GUI:
While the data submitted by PHP-Scripts to my database is displayed correctly, ONLY PMA displays several german Umlaut's (such as äüß, ..) as ü or ä
The problem occurs also while exporting tables to file..
MySQL: 5.0.51a-3ubuntu5.8
PMA: 3.4.5 Database & fields are utf8_general_ciDoes anybody know a solution?
Are you sure that your client is sending data as utf-8?
this seems to me a duplicate of:
German Umlaute in Mysql/Phpmyadmin
You need to ensure you use consistent use of character set/character encoding.
For example, to normalise to UTF-8 content, your DB fields' character sets should be set to UTF-8. Then, in your PHP (if you have your own scripts running that fetch DB information) you need to then add to the head section:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Then, in the PHP, before any output to the browser, include the content type PHP header:
header ('Content-type: text/html; charset=utf-8');
Before you run any SQL to fetch content (so after you connect, but before executing your query), use mysql_set_charset:
mysql_set_charset('utf8',$link);
// $link is optional, refers to your DB connection
You can think of it as three steps:
- The step used to add the characters to your DB
- Storage of characters in your DB
- Retrieval and display of characters
The simplest bet to ensure conformity and that characters display as you anticipate, is to ensure the correct, consistant, character set is defined at each stage.
精彩评论