Jump to content
Sign in to follow this  
Alfraganus

charset utf8 not working

Recommended Posts

I have written charset utf8 in many ways, however, yet my browser are reading my data with many mistakes, how to enable utf-8 in php files?

 

here is my small part of souce code:

<?phpinclude_once("dbconfig.php"); ?>
<?php header('Content-Type: text/html; charset=utf-8');
$con=mysqli_connect("localhost","root","","Alfy");
mysqli_set_charset($con,"utf8");
mb_internal_encoding("UTF-8");
?>
<?php include_once('functions.php'); ?>
<?php include_once('class.paging.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Share this post


Link to post
Share on other sites

If the file itself saved as UTF-8?

 

Make sure to do so in your text editor.

Share this post


Link to post
Share on other sites

What do you see that indicates that the encoding is not correct?

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×