*) handling of quotes in charset string

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

@ -446,7 +446,12 @@ public final class httpHeader extends TreeMap implements Map {
for (int i=1; i < parts.length; i++) {
String param = parts[i].trim();
if (param.startsWith("charset=")) return param.substring("charset=".length()).trim();
if (param.startsWith("charset=")) {
String charset = param.substring("charset=".length()).trim();
if (charset.startsWith("\"") || charset.startsWith("'")) charset = charset.substring(1);
if (charset.endsWith("\"") || charset.endsWith("'")) charset = charset.substring(0,charset.length()-1);
return charset.trim();
}
}
return null;

Loading…
Cancel
Save