How to enter Unicode strings?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

How does one enter Unicode strings into a 5.0.3 MySQL table?
I tried things like
    INSERT INTO tablename(colname) VALUES( _utf8'An')
But this doesn't work. I guess I need an escape sequence, but the MySQL
manual doesn't specify Unicode escape sequences, just for quotes,
newlines and such...

Thanks, Paul.

Re: How to enter Unicode strings?

Following example shows how you specify Unicode character set. This is
copied from the MySQL online manual at

It was posted there, in the "User Comments"  section of that page, by
Robert Mark Bram on September 26 2003:

Simple example:

CREATE TABLE `family` (
`name` varchar(100) NOT NULL,
`savings` decimal(3,2) NOT NULL default '0.00',
`dob` date NOT NULL default '0000-00-00',
PRIMARY KEY (`name`),
UNIQUE KEY `name` (`name`)

Re: How to enter Unicode strings?

Thanks for your reply, but this was not my question. I know how to
define the table, but there seems to be no way whatsoever filling the
table with actual Unicode strings (except programmatically through an
SQL driver, but not from a script or command line).

There just is no syntax for defining Unicode string constants with
characters other than (extended) ASCII. I would expect something like
the HTML escape sequence 水 or the Java "\u6c34" escape sequence,
but they forgot to define something like that...


On 26-04-2005 23:34, wrote:
Quoted text here. Click to load it

Re: How to enter Unicode strings?

Site Timeline