mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-10 21:38:04 -05:00
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.Files;
|
||||||
import java.nio.file.attribute.BasicFileAttributeView;
|
import java.nio.file.attribute.BasicFileAttributeView;
|
||||||
import java.nio.file.attribute.BasicFileAttributes;
|
import java.nio.file.attribute.BasicFileAttributes;
|
||||||
|
import java.text.Normalizer;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.temporal.Temporal;
|
import java.time.temporal.Temporal;
|
||||||
@ -396,6 +397,10 @@ public class ExpressionFormatMethods {
|
|||||||
return Normalization.normalizeQuotationMarks(self);
|
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
|
* Replace multiple replacement pairs
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user