Work need such a function, the following is the implementation code, such as input "friends", the output / u0b67 / ucb53public class UnicodeByteUtil {public static void main (String [] args) {UnicodeByteUtil instance = new UnicodeByteUtil (); BufferedReader reader = new BufferedReader (NEW INPUTSTREAMREADER (System.IN)); string line; try {while ((line = reader.readline ())! = null) {if (line.trim (). Equals ("q")) System.exit 0); string s = instance.getbytes (line); system.out.println ("bytes:" s); //system.out.println ("line :" );}} catch (ooexception e) { E.PrintStackTrace ();}} String getBytes (String s) {stringbuffer out = new stringbuffer (""); byte [] bytes = s.getbytes ("unicode"); for (int i = 2; i < BYTES.LENGTH; I ) {OUT.APPEND ("// u"); string str = integer.tohexstring (bytes [i 1] & 0xff); for (int J = str.length (); j <2;J ) {out.append ("0");} out.append (str1);} return out.toString ();} catch (unsupportedencodingExcection e) {E.PrintStackTrace (); return null;}}}}