http://commons.apache.org/proper/commons-codec/download_codec.cgi
Download commons-codec-1.11-bin.zip , call commons-codec-1.11.jar
Base64 base64 = new Base64();
String base64Sign = base64.encodeToString(string.getBytes("UTF-8"));
The Chinese characters need to be processed in UTF-8, otherwise they will be garbled after encoding.