mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Debug: non single script email addresses
This commit is contained in:
@@ -150,7 +150,7 @@ public class TextHelper {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (us.equals(Character.UnicodeScript.COMMON))
|
||||
if (Character.UnicodeScript.COMMON.equals(us))
|
||||
continue;
|
||||
|
||||
if (script == null)
|
||||
@@ -161,6 +161,23 @@ public class TextHelper {
|
||||
return true;
|
||||
}
|
||||
|
||||
static String getNonLatinCodepoints(String text) {
|
||||
int codepoint;
|
||||
Character.UnicodeScript us;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < text.length(); ) {
|
||||
codepoint = text.codePointAt(i);
|
||||
i += Character.charCount(codepoint);
|
||||
us = Character.UnicodeScript.of(codepoint);
|
||||
if (!Character.isSpaceChar(codepoint) &&
|
||||
!Character.UnicodeScript.COMMON.equals(us) &&
|
||||
!Character.UnicodeScript.LATIN.equals(us))
|
||||
sb.append('<').append(Integer.toHexString(codepoint)).append('>');
|
||||
sb.append(Character.toChars(codepoint));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
static String normalizeNotification(Context context, String text) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean notify_transliterate = prefs.getBoolean("notify_transliterate", false);
|
||||
|
||||
Reference in New Issue
Block a user