Java Char Convert To convertCharSet(String str, String desCharset)

Here you can find the source of convertCharSet(String str, String desCharset)

Description

convert Char Set

License

Open Source License

Declaration

public static String convertCharSet(String str, String desCharset) 

Method Source Code

//package com.java2s;

public class Main {

    public static String convertCharSet(String str, String desCharset) {
        return convertCharSet(str, null, desCharset);
    }/*  www  . ja v a 2s  .c o  m*/

    public static String convertCharSet(String str, String curCharset, String desCharset) {

        String desStr = null;

        try {
            if (str != null) {

                if (curCharset != null) {
                    desStr = new String(str.getBytes(curCharset), desCharset);
                } else {
                    desStr = new String(str.getBytes(), desCharset);
                }
            }
        } catch (Throwable e) {
        }

        return desStr;
    }
}

Related

  1. convertCharacterOffsetToCodePointOffset(String inputStr, int charOffset)
  2. convertCharacters(String fileName)
  3. convertCharArray(char[] arr)
  4. convertCharArrayToIntArray(char[] chars)
  5. convertChars(String orig_name, String chars, char toChar)
  6. convertCharsToUnicodeChars(final String s, final boolean toLowerCase)
  7. convertCharToBoolean(final char value)
  8. convertCharToCharacterArray(final Object originalArray)
  9. convertCharToInt(char input)