Moved LAMP app from Windows to Linux, now got garbled text

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
iain_33
Level 2
Level 2
Posts: 70
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

Moved LAMP app from Windows to Linux, now got garbled text

Post by iain_33 » Mon May 20, 2019 6:21 pm

Not sure if this question is appropriate to this forum, but here goes.

Back in the Windows days I had a self-built web app which ran on a localhost Apache / PHP / MySQL setup. The database collation was set as utf8_general_ci, and all the pages have content-type as charset=utf-8 in the header.

Since I moved the setup to Linux, text from the database isn't showing correctly - in particular, accented characters are garbled. This happens through my web pages, and through phpmyadmin. Not sure where to go and what to change! I thought as long as the collation / content-type was set it would display properly anywhere? Or is this another case of Windows having its own interpretation of "standards"?
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

jchelpau
Level 3
Level 3
Posts: 100
Joined: Mon Mar 25, 2019 11:19 pm
Location: Australia
Contact:

Re: Moved LAMP app from Windows to Linux, now got garbled text

Post by jchelpau » Mon May 20, 2019 10:04 pm

Do you have PHP's multibyte support installed and enabled?

iain_33
Level 2
Level 2
Posts: 70
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

Re: Moved LAMP app from Windows to Linux, now got garbled text

Post by iain_33 » Tue May 21, 2019 12:13 pm

I enabled mbstring with phpenmod mbstring, restarted apache, no luck :(

I checked php.ini, mbstring.http_output wasn't set so I googled it, php.net told me it's deprecated and to use default_charset instead, which is set to UTF-8 already.
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

iain_33
Level 2
Level 2
Posts: 70
Joined: Sat Dec 22, 2018 11:29 am
Location: UK

Re: Moved LAMP app from Windows to Linux, now got garbled text

Post by iain_33 » Tue May 21, 2019 12:42 pm

Looking at it further I wonder if the text itself in the database has become corrupted. I've tried opening the mysqldump file that I restored the database from (created in Windows / restored in Linux), and the accented characters are garbled in there too - I've tried opening it with different encodings in sublime texts and can't get it straight. Puzzled.
Linux Mint 19.1 MATE (64 bit) on a HP G70 laptop (circa 2008)
Intel Pentium Dual Core T3400 @ 2.16GHz -- 3GB RAM -- 1TB HDD
Intel Mobile 4 Series graphics -- Intel 82801I audio
Atheros AR242x/AR542x wireless network adapter

Post Reply

Return to “Other topics”