SQLite Forum

length function for BLOB out of sync with documentation
Login
The documentation for the length function at
https://www.sqlite.org/lang_corefunc.html#length
says that "For a blob value X, length(X) returns the number of bytes
in the blob."

However, when a BLOB contains valid UTF-8 sequences, length returns the 
number of characters, not bytes. This means that LENGTH(column) is less than the number of actual bytes returned from SELECT. This happens even if the value in the BLOB is mostly invalid UTF-8. In that case only the valid UTF-8 sequences get converted to characters before length is calculated.

Since BLOB is intended for arbitrary data, it would seem incongruous for the length function to process it as potential unicode.