Hi List.

Please excuse the cross posting but I've been scouring the archives
and no joy as yet.

I'm trying to get Perl and MySQL using utf8 happily and I've followed
several tutorials but am not getting the same results.

I've got a load of utf8 characters like so (perl):

my %uni = (
        hebrew_alef => {
                character => chr(0x05d0),
                language => "hebrew",
        },
        smiley => {
                character => "\x{263a}",
                language => "none",
        },
);

I am inserting them into MySQL using the dbi module DBD::MySQL

The tutorial said to insert the values like this:
        INSERT INTO unitest (id, aword) VALUES ( "smiley",
CONVERT(_utf8'\x{263a}' USING utf8) );

get the values back like this:
        select aword from unitest where id = "smiley;"
        
then use perl to decode the returned value like so:
        
        decode("utf8", $aword)
        
This doesn't work for me properly. However when I insert them like this:

INSERT INTO unitest (id, aword) VALUES ( "$smiley", '\x{263a}' );

It seems to work for all but the hebrew_alef which is the character chr(0x05d0)

So here's my questions:

Is chr(0x05d0) a unicode character?

Do we need to use CONVERT to insert data (it's seems to working better
without it here, but I don't understand CONVERT and the manual didn't
clear that up for me), or should we be inserting utf8 chars the
standard way.

I'm using mysql 4.1.7 and perl 5.8.1 on OS X 10.3

TIA I'm struggling now.

Angie

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to