1

Because SQLite has problems with upper() and lower() with german umlauts, I need to create a user function in python.

Problem: Data in SQlite: address -> Elsa-Brändström-Str. nn address.upper() -> ELSA-BRäNDSTRöM-STR. nn <-- still small umlauts "ö" and "ä"

Same problem for capital letters if I call lower(). The umlauts just won't change their casing with lower() and upper().

So I can't search for upper WHERE-Clause from my GUI... :-/

I've tried to follow this steps as a first test: https://dzone.com/articles/adding-function-sqlite-python

But always get "sqlite3.OperationalError: user-defined function raised exception"

How could such a "LIKE-"like py-function look like?

SQLite3 python 3.7.1

2
  • Look into building and loading the ICU extension module. Commented Mar 26, 2019 at 16:36
  • @shawn. thanks, was able to create the .so file for Linux. Do you have a DLL for Windows which you could share? Or a simple instruction how to achieve this on Windows? Windows cannot load the so-file. Commented Mar 27, 2019 at 16:19

1 Answer 1

1

use u'ÅÄÖABC' to show it's a unicode string

>>> u'ÅÄÖABC'.lower()
'åäöabc'

and

>>> u'åäöabc'.upper()
'ÅÄÖABC'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.