diff --git a/src/main/java/com/songoda/core/locale/Locale.java b/src/main/java/com/songoda/core/locale/Locale.java index 38b11ee2..31825e84 100644 --- a/src/main/java/com/songoda/core/locale/Locale.java +++ b/src/main/java/com/songoda/core/locale/Locale.java @@ -262,8 +262,6 @@ public class Locale { BufferedReader reader = new BufferedReader(new InputStreamReader((InputStream) stream, charset));) { String line; for (int lineNumber = 0; (line = reader.readLine()) != null; lineNumber++) { - if ((line = line.trim()).isEmpty() || line.startsWith("#") /* Comment */) continue; - if (lineNumber == 0){ // remove BOM markers, if any line = line.replaceAll("[\uFEFF\uFFFE\u200B]", ""); @@ -274,6 +272,8 @@ public class Locale { line = new String(encoded, 0, encoded.length, StandardCharsets.UTF_8); } */ + if ((line = line.trim()).isEmpty() || line.startsWith("#") /* Comment */) continue; + Matcher matcher = NODE_PATTERN.matcher(line); if (!matcher.find()) { System.err.println("Invalid locale syntax at (line=" + lineNumber + "): " + line);