4 ms·
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 pa
by ventana 3mo ago
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.
- bawolff 3mo agoI 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.
- ddlsmurf 3mo agoCan I ask in which use case you'd want UTF-32 text in a column ?
- Rohansi 3mo agoAlso why would you store UTF-32 in text column when SQLite clearly doesn't support it? The docs show there are only methods to pass UTF-8 or UTF-16 text. https://sqlite.org/c3ref/bind_blob.html https://sqlite.org/c3ref/bind_blob.html
- ventana 3mo agoI won't! But I can imagine a Windows developer (well, UTF-16, not UTF-32, but still NULs are everywhere) who might want to put something like that to the database without proper converting.