Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chinese characters are not displaying in php from mysql database

Tags:

php

mysql

I am working on one project which uses multi-language content

http://school.rssas.org

Problem: Chinese characters not displaying in from database

Actually its working on local host with same database files. When i upload it on server charters are not supporting but same time working fine on local , i have tried all solutions related to database.

http://school.rssas.org

like image 476
Vipul Gholap Avatar asked Nov 09 '22 22:11

Vipul Gholap


1 Answers

Try this

header('Content-Type: text/html; charset=utf-8');

Also sometimes what needs to be explained is that the user is sending/expecting UTF-8 encoded data when connecting to the database, so MySQL thinks it's supposed to handle latin1 encoded data and converts it accordingly. Issue the command SET NAMES utf8 after connecting to the db

Please let me know if it still doesn't work

like image 161
prats1411 Avatar answered Nov 14 '22 21:11

prats1411