473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

chinese chars OK in phpmyadmin but ??? on regular php page

I have mysql 5 and php 5.1.2 with chinese chars in utf8 on mysql.
Browsing the tables in phpmyadmin shows correct chinese characters.
However, a custom php page to display them shows only ???

At the top of my php page I did include:

<!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" xml:lang="en" lang="en"
dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Any help?

Thanks!

Feb 12 '07 #1
1 5066
try

http://forums.devshed.com/php-develo...hp+utf-8+mysql

basically change:

<?php

mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );

// continue script...

?>

to

<?php

mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );

// set utf8 unicode mode

mysql_query ( 'SET NAMES utf8' );

// continue script...

?>
On Feb 12, 6:52 am, Loc...@gmail.com wrote:
I have mysql 5 and php 5.1.2 with chinese chars in utf8 on mysql.
Browsing the tables in phpmyadmin shows correct chinese characters.
However, a custom php page to display them shows only ???

At the top of my php page I did include:

<!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" xml:lang="en" lang="en"
dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Any help?

Thanks!

Feb 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Derrick | last post by:
Is it possible? I installed all the language scripts on my XP box, can see russian chars in unicode xml file, but not chinese chars. See the same thing in tree view as when i look at xml file in...
1
by: m.tang | last post by:
Hi, I'm developing a stand alone program using VB accessing Ms Access database. I use NJStar to key in Chinese characters into the system. But I found that certain characters are not able to write...
12
by: Steven Nagy | last post by:
Hi all, I have to do a website in chinese! Basically I just need to know how to output chinese characters. I am assuming its very easy, but have never done it before. I can however do simple...
0
by: st.frey | last post by:
I've got a problem with importing chinese characters into a mysql-table and have read several mailings but didn't find a solution. i have a utf-8 text file that contains chinese characters. the...
1
by: tomtiv | last post by:
Hi All, I am having a probem with asp, xml, com while using chinese chars. The chinese letters come out of com fine and they are also fine when i use asp to write to a text file. When i load...
1
by: guozhen | last post by:
hey.I got a problem I want to parse the string below with regular expression ¡°1¡¢¾«Í¨»ùÓÚJ2EE¼Ü¹¹µÄJavaºËÐÄÓï·¨¡¢Java±à³Ì£¬3ÄêÒÔÉÏÈí¼þ¿ª·¢»òÅàѵÏà¹Ø ¹¤×÷¾­ÑéÕߣ»<?xml:namespace prefix = o ns =...
0
by: Andy Lim | last post by:
Hi all, In my recent project, my client uses Chinese Star software to type the articles in chinese (using MS Word), and I need to display these articles within ASP.NET pages. And, for this very...
0
by: Andy Lim | last post by:
Hi all, In my recent project, my client uses Chinese Star software to type the articles in chinese (using MS Word), and I need to display these articles within ASP.NET pages. And, for this very...
2
by: Victor | last post by:
Hi guys i am facing a real big problem here. I bought a hosting plan and try to build my own website. my website has several language version(chinese english japanese). but i just found out the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.