Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws UnsupportedEncodingException {
- String s = "ô"; //á à
- byte b[] = s.getBytes("UTF-8");
- StringBuilder sb = new StringBuilder();
- for (byte c : b) {
- sb.append("%");
- sb.append(String.format("%02X", c));
- }
- System.out.println(sb);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement