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

Autotimer - case insensitive search doesn't work for utf-8 #405

Closed
Dima73 opened this issue Jan 20, 2021 · 3 comments
Closed

Autotimer - case insensitive search doesn't work for utf-8 #405

Dima73 opened this issue Jan 20, 2021 · 3 comments

Comments

@Dima73
Copy link
Contributor

Dima73 commented Jan 20, 2021

Eurosport 2 НТВ+ event name --> Снукер."Мастерс".1/4 финала (6+)

Add autotimer:

"Match title" --> снукер
"Search type" --> title starts with or partial match
"Search strictness" --> case-insensitive search

No matches found after searching!

Set Match title" --> Снукер
28 matches found after searching!

So, case insensitive search doesn't work.

The problem is somewhere here:
strncasecmp

https://github.com/OpenPLi/enigma2/blob/103d129496df5b236473dc134d2554ba45456f9c/lib/dvb/epgcache.cpp#L2350

Yeah, the standard strcmp of C doesn't understand anything but ASCII (7 bits officially). There are "wide char" functions, but afaik they operate on either 16 or 32 bit "expanded" versions of Unicode, not the "compressed" UTF-8 representation. I am not sure how Python and Perl do this, as, like Betacentauri says, case-indepedent comparison is very complex in Unicode and UTF-8 makes it even harder. Bit masking of bit 5 certainly won't work here

@Dima73 Dima73 changed the title Сase insensitive search doesn't work for utf-8 Autotimer - case insensitive search doesn't work for utf-8 Jan 20, 2021
@Dima73
Copy link
Contributor Author

Dima73 commented Jan 20, 2021

My knowledge with c+ is very small.

@Dima73
Copy link
Contributor Author

Dima73 commented Jan 21, 2021

Maybe need use mbsncasecmp
https://github.com/gagern/gnulib/blob/master/lib/mbsncasecmp.c

@original-birdman
Copy link
Contributor

That has nothing to do with utf-8.

@Dima73 Dima73 closed this as completed Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants