- or download this
Manual, or with Automatic with
...
¦ Console ¦ <<-encode_utf8()--- ¦ strings ¦ <<-decode_utf8()--- ¦ MySQ
+L DB ¦
--------- --------- -----
+-----
- or download this
CREATE TABLE test_db.test ( string VARCHAR(50) ) CHARACTER SET utf
+8;
- or download this
use Encode qw( decode_utf8 );
my $string = <>;
my $utf8_string = decode_utf8($string);
- or download this
use Encode qw( decode );
my $iso_8859_string = <>;
my $utf8_string = decode('ISO-8859-1',$iso_8859_string);
- or download this
use utf8; # Tells Perl that the script itself is written i
+n UTF-8
my $utf8_string = "UTF-8 string with special chars: ñ æ ô";
- or download this
use DBI();
...
{mysql_enable_utf8 => 1}
);
- or download this
$dbh->do('INSERT INTO test_db.test VALUES(?)', $utf8_string);
...
$dbh->do('SELECT string FROM test_db.test LIMIT 1');
my $new_string = $dbh->fetchrow_arrayref->[0];
- or download this
use Encode qw( encode_utf8 );
...
binmode (STDIN,':utf8');
print $new_string;
- or download this
use Encode qw( encode );
print Encode::encode('ISO-8859-1', $new_string);