Java tutorial
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static byte[] getBytes(String s) { try { return s.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { return s.getBytes(); } } }