Android Charset Get isCharsetSupported()

Here you can find the source of isCharsetSupported()

Description

Returns true if charsets are supported in this JRE.

Declaration

static boolean isCharsetSupported() throws IOException 

Method Source Code

//package com.java2s;

import java.io.File;
import java.io.IOException;

import java.nio.charset.Charset;
import java.util.zip.ZipFile;

public class Main {
    /**//www. j  a v a 2  s  . c o m
     * Returns <code>true</code> if charsets are supported in this JRE.
     */
    static boolean isCharsetSupported() throws IOException {
        try {
            ZipFile.class.getConstructor(new Class[] { File.class,
                    Charset.class });
            return true;
        } catch (NoSuchMethodException e) {
            return false;
        }
    }
}

Related

  1. getCharset(String enc)
  2. getLocaleCharset(String locale)