*) Trying to be more tolerant against wrong charset names

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2760 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 18 years ago
parent e9afe39cbb
commit decb09df6d

@ -352,6 +352,18 @@ public final class plasmaParser {
else if ((c >= '0') && (c <= '9')) encoding = "windows-" + encoding.substring(7);
}
if (encoding.toLowerCase().startsWith("iso") && encoding.length() > 3) {
char c = encoding.charAt(3);
if (c == '_') encoding = "ISO-" + encoding.substring(4);
else if ((c >= '0') && (c <= '9')) encoding = "ISO-" + encoding.substring(3);
}
if (encoding.toLowerCase().startsWith("iso") && encoding.length() > 8) {
char c = encoding.charAt(8);
if (c == '_') encoding = encoding.substring(0,8) + "-" + encoding.substring(9);
else if ((c >= '0') && (c <= '9')) encoding = encoding.substring(0,8) + "-" + encoding.substring(8);
}
return encoding;
}

Loading…
Cancel
Save