logoalt Hacker News

ventanatoday at 2:29 AM2 repliesview on HN

So, one fun consequence of this is that Unicode multi-byte strings (not UTF-8 but something like UTF-32) cannot be stored as strings in sqlite without a huge pain. Not that I ever planned to use multi-byte fixed length encodings, but good to know!

A good moment to appreciate the elegance of UTF-8 which allowed to encode multi-byte characters preserving the semantics of C strings.


Replies

ddlsmurftoday at 4:14 AM

Can I ask in which use case you'd want UTF-32 text in a column ?

show 1 reply
bawolfftoday at 3:37 AM

I guess, but it seems like if your encoding is not ascii compatible its better to just store as a blob anyway. Even without the null issue its not like string functions not expecting utf-32 would give reasonable answers.