# HG changeset patch # User Christian Wirth # Date 1439990443 -7200 # Node ID 0556c0056d7170bd00bba293082ca4ed4a511f51 # Parent c6966c8ea83c06ec3fc1352b6a3795cc5f5a30a9 read files in UTF-8 encoding diff -r c6966c8ea83c -r 0556c0056d71 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Tue Aug 18 15:14:19 2015 +0200 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Wed Aug 19 15:20:43 2015 +0200 @@ -789,7 +789,7 @@ return code; } try { - return read(new FileReader(file)); + return read(new InputStreamReader(new FileInputStream(file), "UTF-8")); } catch (IOException e) { } return null; @@ -811,10 +811,12 @@ return new StringReader(code); } try { - return new FileReader(file); + return new InputStreamReader(new FileInputStream(file), "UTF-8"); } catch (FileNotFoundException e) { throw new RuntimeException("Can't find file " + path, e); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("Unsupported encoding in file " + path, e); } }