Fixing Vuze 5300 console user interface encoding bug

Fixing Vuze 5300 console user interface encoding bug

Vuze 5300 has encoding issues in its console user interface. After digging into the source, I found that the encoding issues are caused by org.gudy.azureus2.core3.logging.impl.LoggerImpl$RedirectorStream.

  1. package org.gudy.azureus2.core3.logging.impl;
  2.  
  3. public class LoggerImpl {
  4.  
  5.   // ...
  6.  
  7.   private class RedirectorStream extends OutputStream {
  8.  
  9.     protected PrintStream ps;
  10.     protected StringBuffer buffer = new StringBuffer(1024);
  11.     protected LogIDs logID;
  12.     protected int logType;
  13.  
  14.     protected RedirectorStream(PrintStream _ps, LogIDs _logID, int _logType) {
  15.       ps = _ps;
  16.       logType = _logType;
  17.       logID = _logID;
  18.     }
  19.  
  20.     public void write(int data) {
  21.       char c = (char) data;
  22.       if(c == '\n') {
  23.         if(!bLogToStdOut) {
  24.           ps.println(buffer);
  25.         }
  26.         log(new LogEvent(logID, logType, buffer.toString()));
  27.         buffer.setLength(0);
  28.       } else if(c != '\r') {
  29.         buffer.append(c);
  30.       }
  31.     }
  32.  
  33.     public void write(byte b[], int off, int len) {
  34.       for(int i = off; i < off + len; i++) {
  35.         int d = b[i];
  36.         if(d < 0)
  37.           d += 256;
  38.         write(d);
  39.       }
  40.     }
  41.   }
  42.  
  43.   // ...
  44.  
  45. }

This is not a fix, but I just commented the relevant lines out. Of course the logging is broken, but I do not need it.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

To prevent automated spam submissions leave this field empty.