Hi Monks,

I seem to have a strange problem with my Portuguese characters on a UK-build Kubuntu 9.10 machine with a Firebird database. This is how it goes:

my $a = "Identificação do paciente";print $a,"\n";
(and if you don't have the relevent font on your machine that first word ends '...c-cedilla, a-tilda, o' and displays nicely everywhere on this machine). The string is 25 characters long. However, if I pick the word up from a database I get problems:
my $a = __t("Patient Id");print $a,"\n";
, then I get Identificação do paciente the first word of which ends with 5 characters instead of three. Each accented charater is replaced by 2 characters '... A-tilda, paragraph-character, A-tilda, pound-sign, o'. The string is 27 characters long and when I make it a hash key the hash doen't work. The values come out as '...Next Page...' (which I think comes from my Komodo IDE trying to deal with whatever is in the key) whatever their real contents.

__t is a translate function which looks up the code on a Firebird database. The database is designed in UTF8 everywhere. When I look at it through Flamerobin or any other database utility it looks fine. I have used use utf8; at the beginning of every module and I'm using DBI with an Interbase driver.

my $loc_dsn = <<DSN; dbi:InterBase:dbname=/home/DB/TEST.FDB; ib_dialect=3; DSN $gl_dbh=DBI->connect($loc_dsn,"******","**********", { PrintError => 1, RaiseError => 1 } ) or die "Can't connect to database" . DBI->errstr;

If you have any ideas or suggestions for debugging, then I'd be very grateful.

Regards

Steve.


In reply to Do I have a unicode problem, or is this something else? by Steve_BZ

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.