Home > Net >  postgres: how to count multibyte emoji strings display length in UTF-8
postgres: how to count multibyte emoji strings display length in UTF-8

Time:10-19

Postgres (v11) counts the red heart ❤️ as two characters, and so on for other multibyte UTF-8 chars with selector units. Anyone know how I get postgres to count true characters and not the bytes?

For example, I would like both of the examples below should return 1.

select length('❤️') = 2 (Unicode: 2764 FE0F)

select length('

  • Related