1

I use this code to show Unicode characters in a JavaFX Android app

try{
    String fName = "/img/tahoma.ttf";
    InputStream is = this.getClass().getResourceAsStream(fName);
    Font font = Font.loadFont(is, 15);
    String str =  "\u0633\u0644\u0627\u0645";
    byte[] b = str.getBytes("UTF-8");
    str = new String(b, Charset.forName("UTF-8"));
    Label lbl1 = new Label(str);
    lbl1.setFont(font);
    StackPane v = new StackPane(lbl1);
    Scene scene = new Scene(v, 200, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}
catch(UnsupportedEncodingException ex){
    System.out.println(ex.getMessage());
}

365体育足球滚球比分But it's not working properly. It should be "سلام"

365体育足球滚球比分My app image:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy365体育足球滚球比分

Browse other questions tagged or ask your own question.