Skip to content

Instantly share code, notes, and snippets.

@midoribashikk
Last active November 24, 2016 13:02
Show Gist options
  • Save midoribashikk/e7fa7de52070050341c47e448a8ce043 to your computer and use it in GitHub Desktop.
Save midoribashikk/e7fa7de52070050341c47e448a8ce043 to your computer and use it in GitHub Desktop.
import java.net.URLDecoder;
import java.io.UnsupportedEncodingException;
public class MyLittleDecoder {
public String decode(String str) {
String retstr = "";
try {
retstr = URLDecoder.decode(str, "Windows-31J");
} catch (UnsupportedEncodingException e) {
retstr = "exception...";
}
return retstr;
}
public static void main(String[] args) {
MyLittleDecoder obj = new MyLittleDecoder();
for (String arg : args) {
System.out.println(obj.decode(arg));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment