| SQLITE_UTF8(3) | Library Functions Manual | SQLITE_UTF8(3) |
SQLITE_UTF8,
SQLITE_UTF16LE,
SQLITE_UTF16BE,
SQLITE_UTF16, SQLITE_ANY,
SQLITE_UTF16_ALIGNED,
SQLITE_UTF8_ZT — text
encodings
#include
<sqlite3.h>
#define SQLITE_UTF8
#define SQLITE_UTF16LE
#define SQLITE_UTF16BE
#define SQLITE_UTF16
#define SQLITE_ANY
#define SQLITE_UTF16_ALIGNED
#define SQLITE_UTF8_ZT
These constants define integer codes that represent the various text encodings supported by SQLite.
sqlite3_create_function()
and similar. If the preferred encoding (the 4th parameter to
sqlite3_create_function() - the eTextRep parameter) is SQLITE_ANY, that
indicates that the function does not have a preference regarding the text
encoding of its parameters and can take any text encoding that the SQLite
core find convenient to supply. This option is deprecated. Please do not
use it in new applications.sqlite3_create_collation()
and similar. This encoding value means that the application-defined
collating sequence created expects its input strings to be in UTF16 in
native byte order, and that the start of the strings must be aligned to a
2-byte boundary.sqlite3_result_text64()
and
sqlite3_bind_text64().
The SQLITE_UTF8_ZT encoding means that the input string (call it
"z") is UTF-8 encoded and that it is zero-terminated. If the
length parameter (call it "n") is non-negative, this encoding
option means that the caller guarantees that z array contains at least n+1
bytes and that the z[n] byte has a value of zero. This option
gives the same output as SQLITE_UTF8, but can be more efficient by
avoiding the need to make a copy of the input string, in some cases.
However, if z is allocated to hold fewer than n+1 bytes or if the
z[n] byte is not zero, undefined behavior may result.These declarations were extracted from the interface documentation at line 5825.
#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */ #define SQLITE_UTF16LE 2 /* IMP: R-03371-37637 */ #define SQLITE_UTF16BE 3 /* IMP: R-51971-34154 */ #define SQLITE_UTF16 4 /* Use native byte order */ #define SQLITE_ANY 5 /* Deprecated */ #define SQLITE_UTF16_ALIGNED 8 /* sqlite3_create_collation only */ #define SQLITE_UTF8_ZT 16 /* Zero-terminated UTF8 */
sqlite3_bind_blob(3), sqlite3_create_collation(3), sqlite3_create_function(3), sqlite3_result_blob(3)
| April 29, 2026 | NetBSD 11.99 |