[Bug]: Search doesn't work properly with international characters #1438

Closed
opened 2026-04-24 23:45:28 +02:00 by adam · 4 comments
Owner

Originally created by @plague-doctor on GitHub (Oct 5, 2023).

Describe the issue

Searching for Śmielak produces no results:
snap1
Searching for Michał finds Michał Śmielak:
snap2

Steps to reproduce the issue

  1. Try to search for strings with international characters.

Audiobookshelf version

2.4.4

How are you running audiobookshelf?

Docker

Originally created by @plague-doctor on GitHub (Oct 5, 2023). ### Describe the issue Searching for `Śmielak` produces no results: ![snap1](https://github.com/advplyr/audiobookshelf/assets/10541916/51f3ad6a-951f-4fee-9660-9cfd56f85a19) Searching for `Michał` finds `Michał Śmielak`: ![snap2](https://github.com/advplyr/audiobookshelf/assets/10541916/7fdafb2b-8693-460b-89d0-96f831080bc7) ### Steps to reproduce the issue 1. Try to search for strings with international characters. ### Audiobookshelf version 2.4.4 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:45:28 +02:00
adam closed this issue 2026-04-24 23:45:30 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 5, 2023):

I looked into this and it is because sqlite only handles ASCII characters when converting to lower case.

The first search will be looking for śmielak but sqlite will only compare as Śmielak. The second search works because michał is a match.

In the short term we can handle this by only lower casing ASCII characters. In the long term we could include an extension to sqlite to handle this https://sqlite.org/src/dir/ext/icu

@advplyr commented on GitHub (Oct 5, 2023): I looked into this and it is because sqlite only handles ASCII characters when converting to lower case. The first search will be looking for `śmielak` but sqlite will only compare as `Śmielak`. The second search works because `michał` is a match. In the short term we can handle this by only lower casing ASCII characters. In the long term we could include an extension to sqlite to handle this https://sqlite.org/src/dir/ext/icu
Author
Owner

@plague-doctor commented on GitHub (Oct 5, 2023):

Convert to lower case and search for that should be sufficient for Latin based characters. I am not sure how to handle eg. Asian languages...

@plague-doctor commented on GitHub (Oct 5, 2023): Convert to lower case and search for that should be sufficient for Latin based characters. I am not sure how to handle eg. Asian languages...
Author
Owner

@advplyr commented on GitHub (Oct 6, 2023):

I handled this by not lowercasing the non-ascii chars

image

it just means that śmielak would not return results in this case. Only exact casing matches for non-ascii

@advplyr commented on GitHub (Oct 6, 2023): I handled this by not lowercasing the non-ascii chars ![image](https://github.com/advplyr/audiobookshelf/assets/67830747/645a3a04-2863-451f-9773-83ceca8e4732) it just means that `śmielak` would not return results in this case. Only exact casing matches for non-ascii
Author
Owner

@advplyr commented on GitHub (Oct 29, 2023):

Fixed in v2.5.0

Non-ascii characters are case-sensitive in global search for the reason mentioned above

@advplyr commented on GitHub (Oct 29, 2023): Fixed in [v2.5.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.5.0) Non-ascii characters are case-sensitive in global search for the reason mentioned above
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1438