Make the room filter use normalized strings.
This commit is contained in:
parent
66ca329e8e
commit
a106950051
4 changed files with 32 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
package io.element.android.libraries.core.extensions
|
||||
|
||||
import java.text.Normalizer
|
||||
import java.util.Locale
|
||||
|
||||
fun Boolean.toOnOff() = if (this) "ON" else "OFF"
|
||||
|
|
@ -83,3 +84,8 @@ fun String.safeCapitalize(): String {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun String.withoutAccents(): String {
|
||||
return Normalizer.normalize(this, Normalizer.Form.NFD)
|
||||
.replace("\\p{Mn}+".toRegex(), "")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue