SQLite 3 reference · String Functions
SQLite UNICODE() Function
Return the Unicode code point of the first character of a string, such as 65 for 'A'.
SQLite 3 Since 3.7.16
Syntax
unicode(X)
Parameters
| Parameter | Description |
|---|---|
X |
The string (other values are converted to text). |
Return value
An integer, or NULL for an empty string.
Examples
SELECT unicode('A') AS a, unicode('a') AS lower_a, unicode('é') AS e_acute;
Output
a | lower_a | e_acute 65 | 97 | 233
SELECT name, unicode(name) AS first_code
FROM customers
LIMIT 3;
Output
name | first_code Ada Lovelace | 65 Alan Turing | 65 Grace Hopper | 71
Version history
| Version | Change |
|---|---|
| SQLite 3.7.16 | Added |
In other languages
CHR()· PostgreSQL
Related
CHAR()· Return a string made from Unicode code point numbers, such as char(72, 105) for 'Hi'. The reverse of unicode().- SQL String Functions · tutorial