diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index d370a2c6..82619aa5 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -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 *