Here you can find the source of decodeCharset(String value, String charset)
public static String decodeCharset(String value, String charset)
//package com.java2s; /**/*from w w w. j a v a 2 s. co m*/ * Copyright (c) 2015 SK holdings Co., Ltd. All rights reserved. * This software is the confidential and proprietary information of SK holdings. * You shall not disclose such confidential information and shall use it only in * accordance with the terms of the license agreement you entered into with SK holdings. * (http://www.eclipse.org/legal/epl-v10.html) */ import java.nio.ByteBuffer; import java.nio.charset.Charset; public class Main { public static String decodeCharset(String value, String charset) { try { Charset set = Charset.forName(charset); return set.decode(ByteBuffer.wrap(value.getBytes())).toString(); } catch (Exception ex) { return null; } } }