3

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

asked Jun 6, 2015 at 6:12
8
  • Database collation has higher priority than table or column collation.Take a backup and ALTER db collation Commented 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)? Commented Jun 6, 2015 at 6:45
  • @Mihai I was afraid of that. Time to think... Commented Jun 6, 2015 at 7:57
  • @GordThompson Exactly! But it looks allright, when it comes out on a php page... Commented Jun 6, 2015 at 7:58
  • @Mihai But I have other tables in my database, which are not in Danish... Commented Jun 6, 2015 at 7:59

1 Answer 1

0

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, (削除ここまで)

  1. 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.

answered Jun 7, 2015 at 15:31
Sign up to request clarification or add additional context in comments.

1 Comment

Remove utf8_decode. If you are getting à̃restad, you have Mojibake and don't have ut8 everywhere.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.