On Thu, Jan 19, 2023 at 02:44:57PM +0100, Pavel Stehule wrote:
> Surely it should be fixed. Unfortunately - all the terminals that I can use
> don't support it. So at this moment it may be premature to fix it, because the
> visual form will still be broken.
Yes, none of my terminal emulators handle grapheme clusters either. In
fact, viewing this email messed up my screen and I had to use control-L
to fix it.
I think one big problem is that our Unicode library doesn't have any way
I know of to query the display device to determine how it
supports/renders Unicode characters, so any display width we report
could be wrong.
Oddly, it seems grapheme clusters were added in Unicode 3.2, which came
out in 2002:
https://www.unicode.org/reports/tr28/tr28-3.html
https://www.quora.com/What-is-graphemeCluster
but somehow I am only seeing studying them now.
Anyway, I added a psql item for this so we don't forget about it:
https://wiki.postgresql.org/wiki/Todo#psql
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Embrace your flaws. They make you human, rather than perfect,
which you will never be.