*) UTF-8 Bug solved (hopefully)

See: http://www.yacy-forum.de/viewtopic.php?p=25522

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

@ -492,19 +492,19 @@ public final class httpTemplate {
Object value; Object value;
if (pattern.containsKey(key)) { if (pattern.containsKey(key)) {
value = pattern.get(key); value = pattern.get(key);
//try { try {
if (value instanceof byte[]) { if (value instanceof byte[]) {
replacement = (byte[]) value; replacement = (byte[]) value;
} else if (value instanceof String) { } else if (value instanceof String) {
replacement = ((String) value).getBytes(); //replacement = ((String) value).getBytes();
//replacement = ((String) value).getBytes("UTF-8"); replacement = ((String) value).getBytes("UTF-8");
} else { } else {
replacement = value.toString().getBytes(); //replacement = value.toString().getBytes();
//replacement = value.toString().getBytes("UTF-8"); replacement = value.toString().getBytes("UTF-8");
}
} catch (UnsupportedEncodingException e) {
replacement = dflt;
} }
// } catch (UnsupportedEncodingException e) {
// replacement = dflt;
// }
} else { } else {
replacement = dflt; replacement = dflt;
} }

@ -726,7 +726,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
o = new serverByteBuffer(); o = new serverByteBuffer();
if (zipContent) zippedOut = new GZIPOutputStream(o); if (zipContent) zippedOut = new GZIPOutputStream(o);
httpTemplate.writeTemplate(fis, (zipContent) ? (OutputStream)zippedOut: (OutputStream)o, tp, "-UNRESOLVED_PATTERN-".getBytes()); httpTemplate.writeTemplate(fis, (zipContent) ? (OutputStream)zippedOut: (OutputStream)o, tp, "-UNRESOLVED_PATTERN-".getBytes("UTF-8"));
if (zipContent) { if (zipContent) {
zippedOut.finish(); zippedOut.finish();
zippedOut.flush(); zippedOut.flush();

Loading…
Cancel
Save