Danish alphabetization requires abc... to come before æ, ø and å. In my MySQL database, when I sort alphabetically, it comes out as
Øresund
Åse
Alfa
which is strange.
Server connection collation is utf8_general_ci
Database collation is latin1_swedish_ci
Table collation is utf8_danish_ci
Column collation is utf8_danish_ci
Shouldn't setting a collation on the table/column overwrite collations on a higher level?
My website is all UTF8, and when I input text from the website, it comes fine out again. But when I look at the text in phpmyadmin, characters are displayed wrongly.
I've pasted the contents of the file, editschool.php, here: http://pastebin.com/pv8u0BDj
-
Database collation has higher priority than table or column collation.Take a backup and ALTER db collationMihai– Mihai2015年06月06日 06:15:35 +00:00Commented Jun 6, 2015 at 6:15
-
"when I look at the text in phpmyadmin, characters are displayed wrongly" - Do you mean that what was entered into the website as 'Øresund' shows up in phpMyAdmin as 'Ã ̃resund' (or something like that)?Gord Thompson– Gord Thompson2015年06月06日 06:45:01 +00:00Commented Jun 6, 2015 at 6:45
-
@Mihai I was afraid of that. Time to think...OZ1SEJ– OZ1SEJ2015年06月06日 07:57:46 +00:00Commented Jun 6, 2015 at 7:57
-
@GordThompson Exactly! But it looks allright, when it comes out on a php page...OZ1SEJ– OZ1SEJ2015年06月06日 07:58:25 +00:00Commented Jun 6, 2015 at 7:58
-
@Mihai But I have other tables in my database, which are not in Danish...OZ1SEJ– OZ1SEJ2015年06月06日 07:59:36 +00:00Commented Jun 6, 2015 at 7:59
1 Answer 1
I finally managed to make it work. One or both of these solved the problem:
(削除) 1. Adding mysqli_set_charset($connection,"UTF8"); to the top of my file, (削除ここまで)
- Forcing my FTP client to upload as UTF-8.
Edit: I now consider option 2 of the above by far the most probable, which is why I striked option 1 through.
1 Comment
utf8_decode. If you are getting à̃restad, you have Mojibake and don't have ut8 everywhere.