Reputation: 368
we are using this code but Gujarati fonts not display properly on browser ... my sq l about field have this text "ફૂટપાથ વગરના રોડ ઉપર રાહદારીએ શું કરવું?"
<?
$query = MySQL_query($con,"SELECT * FROM guj1") or die(mysqli_error());
if(MySQL_nun_rows($query)){
while($row=MySQL_fetch_assoc($query)){
echo utf8_decode($row['about']);
}
}
MySQL_close($con);
?>
Upvotes: 3
Views: 4329
Reputation: 3160
Probably not setting the Connection Character Sets and Collations correctly which can be done with the following
mysql_query("SET NAMES 'utf8'");
Upvotes: 2
Reputation: 1650
Include utf-8
header at start of your file
header("Content-Type: text/html; charset=utf-8");
Upvotes: 1
Reputation: 68486
Add this on top of your PHP code !
header('Content-Type: text/html;charset=utf-8');
<?php
header('Content-Type: text/html;charset=utf-8'); //<=---- Add here
$query = MySQL_query($con,"SELECT * FROM guj1") or die(mysqli_error());
if(MySQL_nun_rows($query)){
while($row=MySQL_fetch_assoc($query)){
echo utf8_decode($row['about']);
}
}
MySQL_close($con);
?>
Upvotes: 2