Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lower() function does not encode Sigma correctly #24229

Open
Jason-Waldrop opened this issue Nov 22, 2024 · 1 comment
Open

lower() function does not encode Sigma correctly #24229

Jason-Waldrop opened this issue Nov 22, 2024 · 1 comment

Comments

@Jason-Waldrop
Copy link

https://en.wikipedia.org/wiki/Sigma

Sigma: uppercase Σ, lowercase σ, lowercase in word-final position ς;

Trino does currently convert each "Σ" into a "σ" char.

select
	a,
	lower(a),
	lower(a) = 'νεστορας βλσχος i.k.e.',   -- will is false -> should be true
	LOWER(regexp_replace(a, 'Σ\b', 'ς')),
	LOWER(regexp_replace(a, 'Σ\b', 'ς')) = 'νεστορας βλσχος i.k.e.'  -- will be true
from (values('ΝΕΣΤΟΡΑΣ ΒΛΣΧΟΣ I.K.E.')) as t(a)

this can be used as a quickfix:

LOWER(regexp_replace(lower_me_col, 'Σ\b', 'ς'))
@wendigo
Copy link
Contributor

wendigo commented Nov 22, 2024

@martint can you confirm that this is an expected behaviour?

Converts slice to lower case code point by code point. This method does not perform perform locale-sensitive, context-sensitive, or one-to-many mappings required for some languages. Specifically, this will return incorrect results for Lithuanian, Turkish, and Azeri.
Note: Invalid UTF-8 sequences are copied directly to the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants