Here you can find the source of decode(String s, String charset1, String charset2)
Parameter | Description |
---|---|
s | a parameter |
charset1 | a parameter |
charset2 | a parameter |
public static String decode(String s, String charset1, String charset2)
//package com.java2s; /*/*w w w. ja va 2 s . c o m*/ * $RCSfile: StringUtil,v $$ * $Revision: 1.0 $ * $Date: 2011 $ * * Copyright (C) 2011 GyTech, Inc. All rights reserved. * * This software is the proprietary information of GyTech, Inc. * Use is subject to license terms. */ import java.io.UnsupportedEncodingException; public class Main { public static final String Empty = ""; /** * @param s * @param charset1 * @param charset2 * @return String * @author lizj */ public static String decode(String s, String charset1, String charset2) { if (s != null) { try { return new String(s.getBytes(charset1), charset2); } catch (UnsupportedEncodingException e) { } } return Empty; } }