News for hackers. Stuff that matters.
Re:Nul Characters in Strings in SQLite by ventana on Wednesday July 15, 2026 @10:29PM (#48929720)
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.

Re:Nul Characters in Strings in SQLite by ddlsmurf on Thursday July 16, 2026 @12:14AM (#48930255)
Can I ask in which use case you'd want UTF-32 text in a column ?
Re:Nul Characters in Strings in SQLite by Rohansi on Thursday July 16, 2026 @01:13AM (#48930622)
Also 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

Re:Nul Characters in Strings in SQLite by ventana on Thursday July 16, 2026 @01:47AM (#48930783)
I 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.
Re:Nul Characters in Strings in SQLite by bawolff on Wednesday July 15, 2026 @11:37PM (#48930077)
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.