java进制、编码转换记录

16进制int转16进制String
int a = 0x1f601;        //16进制int(打印无法显示16进制而是10进制:128513)
String b = Integer.toHexString(a);    //(b打印显示为1f601).
10进制int转16进制String
int a = 128513;      
String b = Integer.toHexString(a);    //(b打印显示为1f601).
16进制string转换成10进制int
int x = Integer.parseInt("1f601", 16);   //x为128513
16进制int转unicode编码
int a = 0x1f601; 
int b[] = {a};
String unicode = new String(b, 0, b.length);  // unicode = "\ud83d\ude01"

你可能感兴趣的:(java进制、编码转换记录)