开发者

get Unicode value [PostgreSQL]

开发者 https://www.devze.com 2023-03-26 05:34 出处:网络
If you see this link Its all about unicode code range example : U+0644لd9 84ARABIC LETTER LAM In PostgreSQL i开发者_StackOverflowts easy to get hex value :

If you see this link

Its all about unicode code range

example :

U+0644  ل   d9 84   ARABIC LETTER LAM

In PostgreSQL i开发者_StackOverflowts easy to get hex value :

select encode('ل','hex')

it will return the hex value, d9 84.

but how to get the unicode code point ?

Thanks


If your input string is in UTF-8, you can use the ascii function:

ascii(string) int

ASCII code of the first character of the argument. For UTF8 returns the Unicode code point of the character. For other multibyte encodings. the argument must be a strictly ASCII character.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号