code: static Writer getWriter(OutputStream output, String encoding)
          throws UnsupportedEncodingException
      {
  
          for (int i = 0; i < _encodings.length; ++i)
          {
              if (_encodings[i].name.equalsIgnoreCase(encoding))
              {
                  try
                  {
                      String javaName = _encodings[i].javaName;
                  	OutputStreamWriter osw = new OutputStreamWriter(output,javaName);
                      return osw; 
                  }
                  catch (java.lang.IllegalArgumentException iae) // java 1.1.8
                  {
                      // keep trying
                  }
                  catch (UnsupportedEncodingException usee)
                  {
  
                      // keep trying
                  }
              }
          }
  
          try
          {
              return new OutputStreamWriter(output, encoding);
          }
          catch (java.lang.IllegalArgumentException iae) // java 1.1.8
          {
              throw new UnsupportedEncodingException(encoding);
          }
      }
docs: Returns a writer for the specified encoding based on
  an output stream.
  <p>
  This is not a public API.
  @param output The output stream
  @param encoding The encoding MIME name, not a Java name for the encoding.
  @return A suitable writer
  @throws UnsupportedEncodingException There is no convertor
  to support this encoding
  @xsl.usage internal