code: public static synchronized String char2DOS437( StringBuffer stringbuffer, int i, char c ) {
          if (unicode2DOS437 == null) {
              unicode2DOS437 = new char[0x10000];
              for( int j = 0; j < 256; j++ ) {
                  char c1;
                  if ((c1 = unicode[2][j]) != '\uFFFF')
                      unicode2DOS437[c1] = (char) j;
              }
          }
          if (i != 2) {
              StringBuffer stringbuffer1 = new StringBuffer(stringbuffer.length());
              for( int k = 0; k < stringbuffer.length(); k++ ) {
                  char c2 = unicode2DOS437[stringbuffer.charAt(k)];
                  stringbuffer1.append(c2 == 0 ? c : c2);
              }
  
              return new String(stringbuffer1);
          } else {
              return new String(stringbuffer);
          }
      }
docs: Char to DOS437 converter
  
  @param stringbuffer
  @param i
  @param c
  @return String