import java.nio.charset.StandardCharsets;
import java.util.Arrays;
public class GetUtf8BytesFromString {
public static void main(String[] args) {
String str = "Cyrillic symbol Ы";
//StandardCharsets is available since Java 1.7
//for ealier version use ...