LUCENE-4194: just a taste of what I mean by encoding-sensitive.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1357565 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dawid Weiss 2012-07-05 11:46:33 +00:00
parent 83aa0d66a1
commit 64407ad2ff
2 changed files with 7 additions and 3 deletions

View File

@ -80,7 +80,8 @@ public class Config {
}
// read props from string
this.props = new Properties();
props.load(new ByteArrayInputStream(sb.toString().getBytes()));
// props.load always assumes iso8859-1...
props.load(new ByteArrayInputStream(sb.toString().getBytes("ISO-8859-1")));
// make sure work dir is set properly
if (props.get("work.dir") == null) {

View File

@ -19,7 +19,8 @@ package org.apache.lucene.benchmark.byTask;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.text.Collator;
import java.util.List;
@ -398,7 +399,9 @@ public class TestPerfTasksLogic extends BenchmarkTestCase {
// Run algo
Benchmark benchmark = execBenchmark(algLines1);
BufferedReader r = new BufferedReader(new FileReader(lineFile));
BufferedReader r = new BufferedReader(
new InputStreamReader(
new FileInputStream(lineFile), "UTF-8"));
int numLines = 0;
String line;
while((line = r.readLine()) != null) {