Re: plperlu problem with utf8

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: David Christensen <david(at)endpoint(dot)com>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: plperlu problem with utf8
Date: 2010-12-19 07:16:01
Message-ID: AANLkTi=EPzHCxdfM_nSx8s0Vcdw7dcwf7dZnxFRG1dzt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 18, 2010 at 20:29, David E. Wheeler <david(at)kineticode(dot)com> wrote:
> On Dec 17, 2010, at 9:32 PM, David Christensen wrote:
>    latin=# SELECT * FROM perlgets('“hello”');
>     length │ is_utf8
>    ────────┼─────────
>         11 │ f
>
> (Yes I used Latin-1 curly quotes in that last example).

Erm, latin1 does not have curly quotes, Windows-1252 does. Those are
utf8 quotes AFAICT so 11 is actually right (thats 3 bytes per quote so
that where 11 comes from). If latin1 did have quotes and you used
them you would have gotten the same answer as latin1 is a single byte
encoding. :) I think your terminal tripping you up here.

Postgres also gives the same length:
latin1=# select length('“hello”');
length
--------
11
(1 row)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2010-12-19 07:59:33 Re: can shared cache be swapped to disk?
Previous Message flyusa2010 fly 2010-12-19 07:10:56 Can postgres create a file with physically continuous blocks.