Can't Match Some (Foreign) Films After Table Convert to UTF8 (General or Unicode)

I’ve finally tracked down the cause of my troubles.

Even though I had my database CHARACTER SET and COLLATION defaulted to UTF-8 I added

$mysqli->set_charset("utf8");

Can’t hurt, right?

Alas, still an odd bug.

I double checked the source files character encoding.
Some were UTF-8 no BOM some were not.
Huh?
I double checked,
Yes, my Notepad++ was set to UTF-8 no BOM

Then it dawned on me.

The files I hadn’t renamed were UTF-8 no BOM sure enough.
BUT the files that I had renamed were not.

I know Windows gives a Warning dialog box when file extensions are changed, and rightly so.
But it gives no warning when only the names are changed.
However, when it copies the file (what renaming really is) it doesn’t bring the character encoding along with it.

I fixed up the source files, TRUNCATEd my tables, INSERTed again, and I no longer need mb_convert_encoding() to be able to get characters like
Münster Forlì Østfold Tromsø Skåne Östergötland Västerås

1 Like