Android Charset Convert changeCharset(String str, String from, String to)

Here you can find the source of changeCharset(String str, String from, String to)

Description

change Charset

Declaration

public static String changeCharset(String str, String from, String to)
            throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {
    public static String changeCharset(String str, String from, String to)
            throws UnsupportedEncodingException {
        String newStr = null;//from www.  ja v a2s. c  o m
        newStr = new String(str.getBytes(from), to);
        return newStr;
    }
}

Related

  1. isCharset(final String str, final String charset, int judgeCharsetLength)
  2. toCharset(final String str, final String charset, int judgeCharsetLength)