Java UTF8 From getUTF8(String data)

Here you can find the source of getUTF8(String data)

Description

get UTF

License

Open Source License

Declaration

private static byte[] getUTF8(String data) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.UnsupportedEncodingException;

public class Main {
    private static byte[] getUTF8(String data) {
        try {/* w  w w.ja v  a 2s . com*/
            return data.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            return null;
        }
    }
}

Related

  1. getUTF8(byte[] bytes)
  2. getUTF8(String s)
  3. getUTF8(String string)
  4. getUTF8Bytes(String data)
  5. getUTF8Bytes(String s)