SQLite OCTET_LENGTH() Function
Example
The character with code point 233 is an accented e. It is one character, but two bytes:
SELECT LENGTH(CHAR(233)),
OCTET_LENGTH(CHAR(233));
Try it Yourself »
Definition and Usage
The OCTET_LENGTH() function returns the number of bytes in a text, in the UTF-8 encoding.
For text with only English letters and digits, it is the same as the number of characters. Other characters can use two or more bytes.
Tip: Also look at LENGTH().
Syntax
OCTET_LENGTH(text)
Parameter Values
| Parameter | Description |
|---|---|
| text | Required. The text |
Technical Details
| Return type: | Integer |
|---|---|
| Works in: | SQLite 3.43.0 and later |