Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP MySQL Greek letters showing like ???? marks

I have a table with some text and text is greek letters, when i use sql tool and select the data from this table is showing correctly Image for SQL Query Results

But when i show this my site frontend using mysql_fetch array and when echo it shows as below enter image description here

Anyone know how to fix this error thank you.

like image 697
Suneth Kalhara Avatar asked Aug 04 '12 05:08

Suneth Kalhara


People also ask

Are Greek letters in UTF 8?

The following characters are utf-8 encoded Greek: alpha, beta, gamma, delta, nu, pi, degree (of temperature): α, β, γ, δ, Δ, ν, π, °.


2 Answers

try the following:

after you connect to the mysql, do this query to make sure that you are using UTF8:

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");

make sure that in HTML (head) you are using the right encoding, try:

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

if this does not help, try different encoding, like ISO-8859-1

like image 152
MilMike Avatar answered Oct 05 '22 05:10

MilMike


Try this:

mysqli_set_charset($con, "utf8");

After you connect to DB.

like image 31
Marios Avatar answered Oct 05 '22 03:10

Marios