On Sat, Apr 11, 2020 at 1:56 PM Troy Korjuslommi
<t...@testing-15.tksoft.fi> wrote:
> Please note that in
> https://www.sqlite.org/lang_corefunc.html#length
>
> it says that "For a blob value X, length(X) returns the number of bytes
> in the blob."
 Indeed, if that's a BLOB value. But as yourself noted: "when data is
valid UTF-8, it returns the number of characters" which is in sync
with the datatype notes[1]: "the datatype of a value is associated
with the value itself, not with its container". It doesn't matter that
you defined the column as BLOB. The mentioned string (type) will be
passed to the length() function which say[2]: "returns the number of
characters (not bytes) in X". It works as its documented like you
confirm that in your original message: "it returns the number of
characters, not bytes".
You will get the same answer on the forum, this is how SQLite works
and it's documented correctly. But you are free to ask there and feel
free to report back here.

Regards,
Laszlo/GCS
[1] https://www.sqlite.org/datatype3.htm
[2] https://www.sqlite.org/lang_corefunc.html#length

Reply via email to