乱码- -
public char getRandomChar(){
String str ="";
int hightpos;
int lowpos;
Random random = new Random();
hightpos = (176+Math.abs((random.nextInt(39))));
lowpos =(161+ Math.abs((random.nextInt(93))));
byte b[] =new byte[2];
b[0] = (Integer.valueOf(hightpos)).byteValue();
b[1] = (Integer.valueOf(lowpos)).byteValue();
try {
str =new String(b,"GBK");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return str.charAt(0);
}