Re: Bug in UTF8-Validation Code? - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Bug in UTF8-Validation Code?
Date
Msg-id E1539E0ED7043848906A8FF995BDA57901E7B6D4@m0143.s-mxs.net
Whole thread Raw
In response to Re: Bug in UTF8-Validation Code?  ("Albe Laurenz" <all@adv.magwien.gv.at>)
List pgsql-hackers
> > When the database uses a single byte encoding, the chr function
takes
> > the binary byte representation as an integer number between 0 and
255
> > (e.g. ascii code).
> > When the database encoding is one of the unicode encodings it takes
a
> > unicode code point.
> > This is also what Oracle does.
>
> Sorry, but this is *NOT* what Oracle does.
> At least if we can agree that the code point for the Euro
> sign is 0x20AC.

yes

>
> SQL> SELECT ASCII('EUR') AS DEC,
>   2         TO_CHAR(ASCII('EUR'), 'XXXXXX') AS HEX
>   3  FROM DUAL;
>
>        DEC HEX
> ---------- ----------------------------
>   14844588  E282AC
>
> The encoding in this example is AL32UTF8, which corresponds
> to our UTF8.

You are right, I am sorry. My test was broken.

To get the euro symbol in Oracle with a AL32UTF8 encoding you use
chr(14844588)

Andreas


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Synchronized Scan benchmark results
Next
From: "Simon Riggs"
Date:
Subject: Re: CheckpointStartLock starvation