473,403 Members | 2,270 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,403 software developers and data experts.

MySQL and UTF-8

Hi,

I created a table using :

----------------------------------------------------------------------------
CREATE TABLE test(
unicodeText VARCHAR(45) NOT NULL
)
CHARACTER SET utf8 COLLATE utf8_general_ci;
-----------------------------------------------------------------------------

in php, when i need to query for the data, i need to set the character
set per each connection, i.e.

$DB->query("SET NAMES 'utf8'");

however, i expect this is a kind of overhead ? (a roundtrip delay per
connection)

how to perform this automatically?

I tried to set "default-character-set=utf8 " in my.ini but this didn't
help...

thanks.

Jul 2 '06 #1
1 1162
ho******@gmail.com wrote:
Hi,

I created a table using :

----------------------------------------------------------------------------
CREATE TABLE test(
unicodeText VARCHAR(45) NOT NULL
)
CHARACTER SET utf8 COLLATE utf8_general_ci;
-----------------------------------------------------------------------------

in php, when i need to query for the data, i need to set the character
set per each connection, i.e.

$DB->query("SET NAMES 'utf8'");

however, i expect this is a kind of overhead ? (a roundtrip delay per
connection)

how to perform this automatically?

I tried to set "default-character-set=utf8 " in my.ini but this didn't
help...

thanks.
You could try a MySQL usenet group - like comp.databases.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 2 '06 #2

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

Similar topics

4
by: Aditya Ivaturi | last post by:
We have a CMS which is written is based on php & mysql. Recently we received a request to support multiple languages so that sites in that particular laguage can be created. I did some search on...
5
by: apchar | last post by:
I am trying to use php as a kind of servlet to act as a middle man between a java applet and mysql. I know java has jdbc but it's flakey and painful. php access to mysql is much nicer. So I have:...
0
by: Stian Grytøyr | last post by:
When I submit a query containing a UTF-8 representation (hex value 0xC48D) of the Unicode character &#x010D (lowercase c with caron) to the MySQL server using mysql_query, sniffing the network...
8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
6
by: Jonas Meurer | last post by:
hello, my script selects a comment saved as VARCHAR in MySQL and displays it inside an html page. the problem is, that the comment contains several special characters, as mysterious utf-8...
1
by: Peter King | last post by:
I have a site on a server using ASP and MySQL 3.23.54 (Cobalt Raq server) I have been asked to convert the site to Unicode and need to know: 1) If MySQL 3.23 supports unicode 2) How do I...
2
by: Kevin Laurence | last post by:
Can anyone advise me on the use of UTF-8 in PHP and MySQL? What is the best approach? I would prefer to store HTML extended characters in the database as UTF-8, but I can only get the HTML to...
1
by: andipfaff | last post by:
Hi there, I am fighting with my MysQL database in order to get french and cyrillic characters properly displayed on my website. I've created tables with latin1 charset. My Perl script on the...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
18
by: garbmail10 | last post by:
hallo to everyone I'm trying to convert an older vbscript script to jscript. This has to run on windows script host (not any html). After i've done all the work i realised that when i insert...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.