Alfraganus Posted January 3, 2016 Share Posted January 3, 2016 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"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Link to comment Share on other sites More sharing options...
Ingolme Posted January 3, 2016 Share Posted January 3, 2016 If the file itself saved as UTF-8? Make sure to do so in your text editor. Link to comment Share on other sites More sharing options...
Alfraganus Posted January 5, 2016 Author Share Posted January 5, 2016 I did, I saved with utf-8 encoding in sublime text 3, and I wrote charset-utf8 in html and php header function, i dont know what wrong with it, it is not working yet Link to comment Share on other sites More sharing options...
Ingolme Posted January 5, 2016 Share Posted January 5, 2016 What do you see that indicates that the encoding is not correct? 1 Link to comment Share on other sites More sharing options...
Alfraganus Posted January 7, 2016 Author Share Posted January 7, 2016 I think I did not insert encoding to mysql query Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now