Java GBK String Convert gbk2Utf8(String str)

Here you can find the source of gbk2Utf8(String str)

Description

gbk Utf

License

Open Source License

Declaration

public static final String gbk2Utf8(String str) 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {

    public static final String gbk2Utf8(String str) {
        try {/*from  w w  w .  ja  va  2  s.  c o m*/
            return new String(str.getBytes("GBK"), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return str;
        }
    }
}

Related

  1. gbk2iso(String s)
  2. gbk2Iso(String str)
  3. getGBKByteLength(String data)