byte[] temp1,temp2;
temp1 = yourstring.getBytes("8859-1");
temp2 = yourstring.getBytes("gb2312");
String compstring1,compstring2;
compstring1 = new String(temp1);
compstring2 = new String(temp2);
if(yourstring.equals(temp1))
{
//8859-1;
}试一下这个,我自己写的
else
{
//gb2312;
}
temp1 = yourstring.getBytes("8859-1");
temp2 = yourstring.getBytes("gb2312");
String compstring1,compstring2;
compstring1 = new String(temp1);
compstring2 = new String(temp2);
if(yourstring.equals(temp1))
{
//8859-1;
}试一下这个,我自己写的
else
{
//gb2312;
}
{
//gb2312;
}