Java Canonical Path Create getCanonicalCharset(String charset)

Here you can find the source of getCanonicalCharset(String charset)

Description

get Canonical Charset

License

Apache License

Declaration

public static String getCanonicalCharset(String charset) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.ByteArrayOutputStream;

import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

public class Main {
    private static final OutputStream DUMMY_OUTPUT_STREAM = new ByteArrayOutputStream(0);

    public static String getCanonicalCharset(String charset) throws UnsupportedEncodingException {
        return new OutputStreamWriter(DUMMY_OUTPUT_STREAM, charset).getEncoding();
    }//from www  .  j a va2s.  c om
}

Related

  1. getCanonicalCharsetQuiet(String charset)
  2. getCanonicalDirectory(final String rawDir)
  3. getCanonicalDirectory(String path, String errPrefix)
  4. getCanonicalFile(@Nullable final File aFile)