Here you can find the source of getEncodings()
public static String[] getEncodings()
//package com.java2s; /******************************************************************************* * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved. * http://www.jaspersoft.com./*from www . java 2 s. c o m*/ * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ import java.nio.charset.Charset; import java.util.Set; import java.util.SortedMap; public class Main { private static String[] encodings; public static String[] getEncodings() { if (encodings == null) { SortedMap<String, Charset> m = Charset.availableCharsets(); Set<String> keySet = m.keySet(); encodings = keySet.toArray(new String[keySet.size()]); } return encodings; } }