Make the room filter use normalized strings.
This commit is contained in:
@@ -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(), "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user