utf8 problems

Locked
tom83
Posts: 64
Joined: Thu 22. Aug 2019, 21:33

utf8 problems

Post by tom83 »

Hi,

I'm trying to migrate a php website from Plesk to KeyHelp and I'm having some weird characteres showing on the website (check print).

Image

Not sure what should I have to do. I already exported SQL from Plesk a few times, then tried to import to KeyHelp (phpmyadmin), changed to utf8, and no results.

Seems that in the database those characters are fine. In the website (some places) shows with wrong characteres.
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: utf8 problems

Post by Alexander »

Hello,

here some hints to ensure proper UTF-8 usage:

1) Use PHP-Header:

Code: Select all

header('Content-Type: text/html; charset=UTF-8');
2) Use HTML meta tag

Code: Select all

<meta charset="utf-8">

3) Set the database connection charset when connecting to the database (Choose one, depending on your application):
mysqli_set_charset / SET NAMES utf8 / PDO-DSN connection string "mysql:host=...;port=...;dbname=...;charset=utf8;"

4) Check the database charset of the database / tables (eg. with phpMyAdmin)


There are more places to check, depending on you application.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
Tobi
Community Moderator
Posts: 2812
Joined: Thu 5. Jan 2017, 13:24

Re: utf8 problems

Post by Tobi »

I think he got the solution.
sonderzeichen.png
😁
Gruß,
Tobi


-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Locked