#!/usr/bin/perl -w use strict; use warnings; use Encode; use DBI; use feature 'unicode_strings'; use Devel::Peek qw< Dump >; binmode(STDOUT, ":utf8"); my $db = "..."; my $user = "..."; my $pw = '...'; my $host = "..."; my $options = {RaiseError => 1, AutoCommit => 1, mysql_enable_utf8 => 1}; my $dbh = DBI->connect("DBI:mysql:$db:$host", $user, "$pw", $options) || die "Could not connect to database!"; my $sql = 'select post_id, post_text from phpbb_posts where post_id = 24358'; my $sth = $dbh->prepare($sql); $sth->execute() or die "Error: $DBI::errstr"; my ($id, $text) = $sth->fetchrow_array; print "id: $id text: $text"; Dump( $text ); $text =~ s/├â┬ñ/ä/g; $text =~ s/├â┬Â/ö/g; $text =~ s/├â┼©/ß/g; $text =~ s/├â┬╝/ü/g; print "\nid: $id text: $text"; Dump( $text );