1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 03:25:49 +01:00

Force FlattenToAsciiTransliterator to return only ASCII

This commit is contained in:
Arjan Schrijver 2023-02-05 15:54:14 +01:00 committed by Arjan Schrijver
parent 735f27d5bf
commit 0b241af8e7

View File

@ -18,6 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.util.language.impl;
import java.nio.charset.StandardCharsets;
import java.text.Normalizer;
import java.util.HashMap;
@ -32,6 +33,7 @@ public class FlattenToAsciiTransliterator implements Transliterator {
}
txt = Normalizer.normalize(txt, Normalizer.Form.NFD);
txt = new String(txt.getBytes(StandardCharsets.US_ASCII), StandardCharsets.US_ASCII);
return txt.replaceAll("\\p{M}", "");
}
}