Well, please see the screen shot that is attached in this thread. Multi-byte character is NOT displayed correctly in the log tailing view page. This is a major bug. I investigated its cause and just found it. There is the problem in LineReader class. In LineReader constructer, BackwardsFileStream object is wrapped into new InputStreamReader instance. -------------------------------------------------------------------------------------------------------------- public LineReader(InputStream stream, boolean backwards) { this.readBackwards = backwards; this.streamReader = new InputStreamReader(stream); -> HERE! tokenizer = new Tokenizer(streamReader); tokenizer.addSymbol(new TokenizerSymbol(LINE_SEPARATOR, "\n", null, false, false, true, false)); tokenizer.addSymbol(new TokenizerSymbol(LINE_SEPARATOR, "\r", null, false, false, true, false)); if (backwards) { tokenizer.addSymbol(new TokenizerSymbol(LINE_SEPARATOR, "\n\r", null, false, false, true, false)); } else { tokenizer.addSymbol(new TokenizerSymbol(LINE_SEPARATOR, "\r\n", null, false, false, true, false)); } } -------------------------------------------------------------------------------------------------------------- In this case, only bytes of the multi-byte character are not decoded correctly because they are the reversed byte codes, and the InputStreamReader always returns wrong character as result. The root cause is that the InputStreamReader reads the reversed bytes and decodes them into characters. Therefore the "read-line" algorithm in the LineReader class has to be reconsidered fundamentally.
|