0

After enabling Jack Options i can't print a String with special characters such as the euro sign (€) or Greek letters.I've tried to change encoding to UTF-8 with no luck.Any suggestions?Disabling Jack Options solves the problem, but i need Java 8 support.

String str="€";
byte[] arrByte = new byte[0];

    try {
        arrByte = str.getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {e.printStackTrace();}

    System.out.println(new String(arrByte));
tasgr86
  • 299
  • 2
  • 7
  • 17
  • Did you try using €? (it might need to be in strings.xml instead of hardcoded, so it gets evaluated) – Nick Cardoso Feb 22 '17 at 16:51
  • Using unicode values solves the problem but since i have a long text with different characters that's not very convenient – tasgr86 Feb 22 '17 at 17:04

1 Answers1

0

I added the following line, as was suggested here, in gradle.properties and the encoding seems to be fixed now.

org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Community
  • 1
  • 1
tasgr86
  • 299
  • 2
  • 7
  • 17