mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-20 08:54:37 -04:00
*) 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
This commit is contained in:
source/de/anomic/http
@ -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();
|
||||
|
Reference in New Issue
Block a user