import java.nio.charset.StandardCharsets; import java.util.Arrays; public class GetUtf8BytesFromString { public static void main(String[] args) { String str = "Cyrillic symbol Ы"; //自Java 1.7起提供StandardCharsets //for ealier version use Charset.forName("UTF-8"); byte[] textInUtf8 = str.getBytes(StandardCharsets.UTF_8); System.out.println(Arrays.toString(textInUtf8)); } }