I am trying to create an image and put japanese text on it . It works fine in local. but when I upload and deploy my project in amazone web service ec2 , the japanese text displays squares in the image . (I am using wildfly 9 as server )
Image created :
my code is below :
void CreateImage(String topic, String name, String id, boolean candidate,int idvideo) {
try {
BufferedImage bufferedImage = ImageIO
.read(new File(ImagePath));
Graphics graphics = bufferedImage.getGraphics();
String myString="承認待ち he new guy ट्रेल्स " ;
graphics.setColor(Color.BLACK);
byte ptext[] = myString.getBytes("UTF-8");
String value;
value = new String(ptext, "UTF-8");
graphics.setFont(new Font("Arial", Font.PLAIN, 10));
graphics.drawString(value, 10, 90);
if (id != null && !id.equals("")) {
graphics.drawString("大学で学んだこと", 0, 100);
}
if (candidate) {
ImageIO.write(bufferedImage, "png",
new File( path1));
} else {
ImageIO.write(bufferedImage, "png",
new File(path2));
}
} catch (Exception exception) {
exception.printStackTrace();
}
}