From 758bd7f817f825ca4f1e388700b00c14bee294a2 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 31 Mar 2017 18:09:04 +0800 Subject: [PATCH] ISO-8859-8-I is not supported, but ISO-8859-8 uses the same code points so we can use that instead --- source/net/filebot/util/FileUtilities.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/util/FileUtilities.java b/source/net/filebot/util/FileUtilities.java index e8b6566e..ee4a855e 100644 --- a/source/net/filebot/util/FileUtilities.java +++ b/source/net/filebot/util/FileUtilities.java @@ -246,12 +246,19 @@ public final class FileUtilities { CharsetMatch match = detector.detect(); if (match != null) { Reader reader = match.getReader(); + + // reader may be null if detected character encoding is not supported if (reader != null) { return reader; } - // reader may be null if detected character encoding is not supported - debug.warning("Unsupported charset: " + match.getName()); + // ISO-8859-8-I is not supported, but ISO-8859-8 uses the same code points so we can use that instead + switch (match.getName()) { + case "ISO-8859-8-I": + return new InputStreamReader(in, Charset.forName("ISO-8859-8")); + default: + debug.warning("Unsupported charset: " + match.getName()); + } } }