On Tue, Jun 17, 2003 at 05:12:06PM +0200, Brigitte Jellinek wrote:
> > On Tue, Jun 17, 2003 at 11:57:25AM +0200, Brigitte Jellinek wrote:
> > > [...] I write utf-8 into mysql -
> > > that seems to work.  but when I read it back, not only do I get
> > > a "classical perl string" instead of an utf8 string, but also some
> > > of the bits are broken:
> 
> On Tue, Jun 17, 2003 at 11:36:13AM +0100, Tim Bunce answered:
> > Please try using another tool (eg mysqldump) to read the data from
> > the db to check if the problem is related to inserting the data
> > and/or retrieving it.  Also try not using placeholders.
> 
> ok, i tried both:  mysqldump confirms: the problem is not
> in inserting, but in reading from the db.

wrong!  actually, the problem is in the inserting.

I'm now inserting it two ways:

1) from perl directly via DBI
2) perl -> file with sql -> mysql client

the file with the sql statements is still ok.  if I look at the
data with the mysql-commandline client, version 1 and version 2 look the
same:

+------+------+------+-------+
| ID   | code | vc   | count |
+------+------+------+-------+
| 3058 | 010D | �?   |     3 |
| 3167 | 010D | �?   |     3 |
+------+------+------+-------+

when I read it out using perl+dbi, i get for example
for the unicode-character \x{010D}, which should be c with a reverse ^ on top, 
  the bits 1100010000111111 
instead of 1100010010001101

ps.
    i still use perl(5.8) + dbi(1.37) + dbd::mysql(2.1026) + mysql(4.1.0-alpha)
 
pps. 
    my table for this example is
        CREATE TABLE chartab (
          ID mediumint(9) NOT NULL auto_increment,
          code varchar(10) default NULL,
          vc varchar(10) default NULL,
          count int(8),
          PRIMARY KEY  (ID)
        ) TYPE=MyISAM CHARSET=utf8;
         

-- 
Dipl.Ing. Brigitte Jellinek                     Horus GmbH
http://www.horus.at/team/bjelli.html     Internet Beratung + Schulung
[EMAIL PROTECTED]                       Web Design + Software Engineering

Reply via email to