in reply to hexadecimal character

Allow me to propose the following, as a sort of experiment for you to perform. You can go ahead and fold this snippet into your perl script (it is a perl script you're talking about, isn't it?), and let us know what sort of output you see on your terminal as a result of running the code with this snippet.
# Let's pretend you have the troublesome string returned by your # DB, and that string is stored in a variable called "$db_string". # (if it's actually stored in a variable called "$x", you # could adapt it to this snippet by adding the line: # my $db_string = $x; my @db_chars = (); for my $db_char ( split //, $db_string ) { push @db_chars, sprintf( "%02x", ord( $db_char )); } for my $db_char ( @db_chars ) { printf "== %s == %s ==\n", $db_char, chr(hex($db_char)); }
That will show you the actual hex codes of each (single-byte) character in the string from the database, along with the way that single-byte character appears on your screen when printed in its "raw" form. If the database string is really long, you can limit the second loop to just enough iterations to clarify what's happening -- e.g. if 15 characters is enough:
for my $db_char ( @db_chars[0..14] ) { ...
Once you've done that, try to learn something about what is actually in the database. What language is it (Greek? Russian? Chinese?), what encoding is it in (ISO-8859?, utf8? GBK?), what is it supposed to look like when it's displayed correctly (and do you have the font needed to do that)?