lovasoa / SQLpage

SQL-only webapp builder, empowering data analysts to build websites and applications quickly
https://sql.ophir.dev
MIT License
895 stars 63 forks source link

Add unicode support in the built-in SQLite database #155

Closed lovasoa closed 5 months ago

lovasoa commented 7 months ago

SQLPage includes a statically linked version of SQLite. SQLite by default does not support unicode (for case-insensitive matching, the UPPER and LOWER functions, ...).

To avoid binary bloat, SQLite recommends that applications overload SQLite functions with unicode-aware versions using the unicode libraries the software already uses: https://www.sqlite.org/faq.html#q18

SQLPage could overload unicode functions using rust's standard library unicode-aware functions.

lovasoa commented 7 months ago

In the meantime, one can use Combining Diacritical Marks instead of accentuated characters:

update my_table set my_text_field=
replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(
my_text_field,
'Û','Û'),'Ü','Ü'),'Ý','Ý'),'à','à'),'á','á'),'â','â'),'ã','ã'),'ä','ä'),'ç','ç'),'è','è'),'é','é'),'ê','ê'),'ë','ë'),'ì','ì'),'í','í'),'î','î'),'ï','ï'),'ñ','ñ'),'ò','ò'),'ó','ó'),'ô','ô'),'õ','õ'),'ö','ö'),'ù','ù'),'ú','ú'),'û','û'),'ü','ü'),'ý','ý');

example

DSMejantel commented 7 months ago

Good idea for "é" with the upper function. But in french language, we need the same thing for É. And Émile is after Henri in my list !