Added String.isLatin()
@see https://www.filebot.net/forums/viewtopic.php?f=5&t=2&p=28963#p28963
This commit is contained in:
parent
a53d719e07
commit
395ec3a4b8
|
@ -14,6 +14,7 @@ import java.io.IOException;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.attribute.BasicFileAttributeView;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.text.Normalizer;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.Temporal;
|
||||
|
@ -396,6 +397,10 @@ public class ExpressionFormatMethods {
|
|||
return Normalization.normalizeQuotationMarks(self);
|
||||
}
|
||||
|
||||
public static boolean isLatin(String self) {
|
||||
return Normalizer.normalize(self, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}", "").matches("^\\p{InBasicLatin}+$");
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace multiple replacement pairs
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue