Re: ucs_wcwidth vintage

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ucs_wcwidth vintage
Date: 2017-11-03 17:38:27
Message-ID: 20171103173827.oc6pkew4uepkt3kp@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Munro wrote:
> Hi hackers,
>
> src/backend/utils/mb/wchar.c contains a ~16 year old wcwidth
> implementation that originally arrived in commit df4cba68, but the
> upstream code[1] apparently continued evolving and there have been
> more Unicode revisions since. It probably doesn't matter much: the
> observation made by Zr40 in the #postgresql IRC channel that lead me
> to guess that this code might be responsible is that emojis screw up
> psql's formatting, since current terminal emulators recognise them as
> double-width but PostgreSQL doesn't. Still, it's interesting that we
> have artefacts deriving from various different frozen versions of the
> Unicode standard in the source tree, and that might affect some proper
> languages.
>
> πŸ€”

Ah, thanks for the test case:

alvherre=# select 'πŸ€”', 'hello';
?column? β”‚ ?column?
──────────┼──────────
πŸ€” β”‚ hello
(1 fila)

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
image/png 8.2Β KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-11-03 17:41:45 Re: [PATCH] Add ALWAYS DEFERRED option for constraints
Previous Message Peter Eisentraut 2017-11-03 17:37:39 Re: Add some const decorations to prototypes