Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > SELECT E'TAB\x9TAB' AS "Single Byte", E'\xF0\x9F\x91\xBE' AS "UTF-8 bytes"; > > <pre> > Single Byte | UTF-8 bytes > :------------- | :---------- > TAB TAB | 👾 > </pre> <!-- --> > SELECT E'\u0F02' AS "Code Point", > E'\uD83D\uDC7E' AS "UTF-16 Surrogate Pair", > E'\U0000D83D\U0000DC7E' AS "UTF-16 Surrogate Pair via UTF-32", > E'\U0001F47E' AS "UTF-32"; > > <pre> > Code Point | UTF-16 Surrogate Pair | UTF-16 Surrogate Pair via UTF-32 | UTF-32 > :--------- | :-------------------- | :------------------------------- | :----- > ༂ | 👾 | 👾 | 👾 > </pre> <!-- --> > SELECT E'\U0010FFFF' AS "Highest UTF-32 Code Point"; > > <pre> > | Highest UTF-32 Code Point | > | :------------------------ | > | 􏿿 | > </pre> <!-- --> > SELECT E'\U00110000' AS "1 Value Higher Than Highest UTF-32 Code Point is Invalid"; > > <pre> > ERROR: invalid Unicode escape value at or near &quot;E'\U00110000&quot; LINE 1: SELECT E'\U00110000' AS &quot;1 Value Higher Than Highest UTF-32 ... ^ > </pre> <!-- --> > SELECT U&'\0F02' AS "Code Point", > U&'\D83D\DC7E' AS "UTF-16 Surrogate Pair", > U&'\+00D83D\+00DC7E' AS "UTF-16 Surrogate Pair via UTF-32", > U&'\+01F47E' AS "UTF-32"; > > <pre> > Code Point | UTF-16 Surrogate Pair | UTF-16 Surrogate Pair via UTF-32 | UTF-32 > :--------- | :-------------------- | :------------------------------- | :----- > ༂ | 👾 | 👾 | 👾 > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=postgres_11&fiddle=0ce292fcacf79dd624ba5bb0d34aceb0)*
back to fiddle