in reply to Encoding of DBI PostgreSQL output

Note that if you have characters uper than 255, you can't represent them with ASII(extended|8-bit) (Latin1). Probably you already know that, but I don't know if the Norwegian characters are or not uper than 255.

But you can use pack to check the index of the character:

$utf8_char = pack("U", 300 ) ; ## Change here for 'XX' (the char). print unpack("U", $utf8_char ) ;

Graciliano M. P.
"The creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Encoding of DBI PostgreSQL output
by Kjetil (Sexton) on May 20, 2003 at 19:43 UTC
    I must admit I didn't really understand that, I tried to replace U with å, but it didn't turn out anything sensible.

    However, I think that the Norwegian characters are within the usual 8 bit, in ISO-8859-1, ø is E8 (in hex), and that's the last of the interesting characters.

      No! You must change the value of $utf8_char.

      I put a pack() in the place of the value, since my OS is only ASCII.

      Graciliano M. P.
      "The creativity is the expression of the liberty".

        Ah, I see, of course... :-)

        å is 229, it responds, so it isn't that, at least it is not the immediate problem, allthough it could be related...