Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: DBI inserting accents

by packetstormer (Monk)
on Mar 21, 2012 at 16:02 UTC ( #960804=note: print w/ replies, xml ) Need Help??


in reply to Re: DBI inserting accents
in thread DBI inserting accents

I have looked at that post but it is not making sense to me to be honest. For example, is says from with a Perl script just "use utf8" then $dbh->do('INSERT INTO test_db.test VALUES(?)', $utf8_string);
However, if I do this I get this error:
DBI::db=HASH(0x9eecc70)->do(...): attribute parameter 'Sťan' is not a hash ref at insert.pl line 15

Also, I don't have any problem displaying the text, only inserting.
I have tried "binmode...." also but I can't get anything to work.


Comment on Re^2: DBI inserting accents
Download Code
Replies are listed 'Best First'.
Re^3: DBI inserting accents
by poj (Priest) on Mar 21, 2012 at 17:08 UTC
    try adding undef
    $dbh->do('INSERT INTO test_db.test VALUES(?)', undef, $utf8_string);
    poj

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-07-31 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls