toString() methods on term/queries/etc are wrong: assume utf-8 encoded bytes.
-----------------------------------------------------------------------------
Key: LUCENE-2942
URL: https://issues.apache.org/jira/browse/LUCENE-2942
Project: Lucene - Java
Issue Type: Bug
Affects Versions: 4.0
Reporter: Robert Muir
In Lucene's trunk, a Term is just a Bytesref.
In a lot of cases this is a UTF-8 encoded string, but in some cases its not
(e.g. collation fields).
The problem is that the toString methods all currently call utf8ToString().
This is wrong, though from a practical point of view i think just printing the
bytes won't be very helpful for debugging most cases where the bytes really are
utf-8 encoded.
So i think in these cases we should use the following technique: if the bytes
are a valid utf-8 sequence, use BytesRef.utf8tostring(), otherwise just print
the bytes: BytesRef.toString()
its no problem for performance because toString is only for debugging anyway.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]