mirror of https://github.com/apache/lucene.git
Correcting getByte() sensitive to local file.encoding.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1357493 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c92eb67f6d
commit
e91e59af95
|
@ -51,8 +51,8 @@ public class TestDocument extends LuceneTestCase {
|
|||
FieldType ft = new FieldType();
|
||||
ft.setStored(true);
|
||||
IndexableField stringFld = new Field("string", binaryVal, ft);
|
||||
IndexableField binaryFld = new StoredField("binary", binaryVal.getBytes());
|
||||
IndexableField binaryFld2 = new StoredField("binary", binaryVal2.getBytes());
|
||||
IndexableField binaryFld = new StoredField("binary", binaryVal.getBytes("UTF-8"));
|
||||
IndexableField binaryFld2 = new StoredField("binary", binaryVal2.getBytes("UTF-8"));
|
||||
|
||||
doc.add(stringFld);
|
||||
doc.add(binaryFld);
|
||||
|
|
|
@ -166,7 +166,7 @@ public class TestNumericRangeQueryBuilder extends LuceneTestCase {
|
|||
|
||||
private static Document getDocumentFromString(String str)
|
||||
throws SAXException, IOException, ParserConfigurationException {
|
||||
InputStream is = new ByteArrayInputStream(str.getBytes());
|
||||
InputStream is = new ByteArrayInputStream(str.getBytes("UTF-8"));
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
|
|
|
@ -67,7 +67,7 @@ final class MockPayloadFilter extends TokenFilter {
|
|||
@Override
|
||||
public boolean incrementToken() throws IOException {
|
||||
if (input.incrementToken()) {
|
||||
payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes()));
|
||||
payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes("UTF-8")));
|
||||
int posIncr;
|
||||
if (pos == 0 || i % 2 == 1) {
|
||||
posIncr = 1;
|
||||
|
|
Loading…
Reference in New Issue