Skip to content

upper and lower functions only work correctly on ascii characters #9053

@Omega359

Description

@Omega359

Describe the bug

Upper and lower should function against the unicode code properties for their respective case. I believe this boils down to using string.to_ascii_lowercase() and string.to_ascii_uppercase() vs string.to_lowercase() and string.to_uppercase()

If you use a unicode LC_CTYPE in postgres (not C) then the corresponding calls will properly respect the unicode code properties.

To Reproduce

❯ select upper('árvore ação αβγ');
+--------------------------------+
| upper(Utf8("árvore ação αβγ")) |
+--------------------------------+
| áRVORE AçãO αβγ |
+--------------------------------+

❯ select lower('ÁRVORE AÇÃO ΑΒΓ');
+--------------------------------+
| lower(Utf8("ÁRVORE AÇÃO ΑΒΓ")) |
+--------------------------------+
| Árvore aÇÃo ΑΒΓ |
+--------------------------------+

Expected behavior

upper and lower respect the unicode code maps.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions