Skip to content

Instantly share code, notes, and snippets.

@langjun
Last active June 22, 2016 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save langjun/8046618e3690e8de0c9df623a93e88e5 to your computer and use it in GitHub Desktop.
Save langjun/8046618e3690e8de0c9df623a93e88e5 to your computer and use it in GitHub Desktop.
Java IOS8859-1编码字符串转utf8格式
public class Main {
public static void main(String args[]) {
String tmp = "\346\212\261\346\255\211\357\274\214\346\240\271\346\215\256\347\233\270\345\205\263\346\263\225\345\276\213\346\263\225\350\247\204\345\222\214\346\224\277\347\255\226\357\274\214\346\234\254\345\220\247\346\232\202\344\270\215\345\274\200\346\224\276\357\274\214\345\216\273\347\234\213\347\234\213\345\205\266\344\273\226\350\264\264\345\220\247";
try {
System.out.println(new String(tmp.getBytes("ISO8859-1"),"utf-8"));
}catch(Exception e) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment