Java Encode encode_u8(String what)

Here you can find the source of encode_u8(String what)

Description

encodu

License

Open Source License

Declaration

private static final byte[] encode_u8(String what) 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {
    private static final byte[] encode_u8(String what) {
        byte u8[];
        if (what == null) {
            u8 = null;/* w ww . j  ava 2 s.  c o m*/
        } else {
            try {
                u8 = what.getBytes("UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
                throw new InternalError(e.toString());
            }
        }
        return u8;
    }
}

Related

  1. encode(Object o)
  2. encode(Object obj)
  3. encode(Serializable s)
  4. encode(T obj)
  5. encode2Encode(String original, String encode1, String encode2)
  6. encodeAddresses(String string, String charset)
  7. encodeArguments(final String arg)
  8. encodeArray(String[] sourceArray, String sysCharset, String charset)
  9. encodeAsModifiedUTF8(String str)