*) 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;
if (pattern.containsKey(key)) {
value = pattern.get(key);
//try {
if (value instanceof byte[]) {
replacement = (byte[]) value;
} else if (value instanceof String) {
replacement = ((String) value).getBytes();
//replacement = ((String) value).getBytes("UTF-8");
} else {
replacement = value.toString().getBytes();
//replacement = value.toString().getBytes("UTF-8");
try {
if (value instanceof byte[]) {
replacement = (byte[]) value;
} else if (value instanceof String) {
//replacement = ((String) value).getBytes();
replacement = ((String) value).getBytes("UTF-8");
} else {
//replacement = value.toString().getBytes();
replacement = value.toString().getBytes("UTF-8");
}
} catch (UnsupportedEncodingException e) {
replacement = dflt;
}
// } catch (UnsupportedEncodingException e) {
// replacement = dflt;
// }
} else {
replacement = dflt;
}

@ -726,7 +726,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
o = new serverByteBuffer();
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) {
zippedOut.finish();
zippedOut.flush();

Loading…
Cancel
Save