Module jEdit

Class EncodingServer

java.lang.Object
org.gjt.sp.jedit.io.EncodingServer

public class EncodingServer extends Object
A class for some static methods to deal with encodings.
Since:
4.3pre10
Author:
Kazutoshi Satoda
  • Constructor Details

    • EncodingServer

      public EncodingServer()
  • Method Details

    • getEncoding

      public static Encoding getEncoding(String name)
      Returns an instance of Encoding for specified name. The name is used for search the following domains in the listed order. - java.nio.charset.Charset - jEdit ServiceManager
    • getAvailableNames

      public static Set<String> getAvailableNames()
      Returns the set of all available encoding names.
    • getSelectedNames

      public static Set<String> getSelectedNames()
      Returns the set of user selected encoding names.
    • getTextReader

      public static Reader getTextReader(InputStream in, String encoding) throws IOException
      Returns a Reader object that reads the InputStream with the encoding. This method is same with "getEncoding(encoding).getTextReader(in)".
      Throws:
      IOException
    • getTextWriter

      public static Writer getTextWriter(OutputStream out, String encoding) throws IOException
      Returns a Writer object that writes to the OutputStream with the encoding. This method is same with "getEncoding(encoding).getTextWriter(out)".
      Throws:
      IOException
    • hasEncoding

      public static boolean hasEncoding(String name)
      Returns if the specified name is supported as a name for an Encoding.