Reading the game's content in UTF-8
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 01 Oct 2009 10:50:29 +0200
changeset 118bbe71fd2f13b
parent 117 c1057591a344
child 119 26685a525ec8
Reading the game's content in UTF-8
webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java
     1.1 --- a/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java	Thu Oct 01 06:06:55 2009 +0200
     1.2 +++ b/webidor/src/test/java/cz/xelfi/quoridor/webidor/resources/ChatTest.java	Thu Oct 01 10:50:29 2009 +0200
     1.3 @@ -32,12 +32,13 @@
     1.4  import cz.xelfi.quoridor.webidor.Game;
     1.5  import cz.xelfi.quoridor.webidor.GameId;
     1.6  import cz.xelfi.quoridor.webidor.Note;
     1.7 -import cz.xelfi.quoridor.webidor.QuoridorTest;
     1.8  import java.io.File;
     1.9 +import java.io.FileInputStream;
    1.10  import java.io.FileNotFoundException;
    1.11  import java.io.FileOutputStream;
    1.12 -import java.io.FileReader;
    1.13  import java.io.IOException;
    1.14 +import java.io.InputStreamReader;
    1.15 +import java.io.Reader;
    1.16  import java.util.List;
    1.17  import java.util.ResourceBundle;
    1.18  import javax.ws.rs.core.MediaType;
    1.19 @@ -200,7 +201,7 @@
    1.20  
    1.21      private String readFile(File game) throws IOException, FileNotFoundException {
    1.22          char[] arr = new char[4096];
    1.23 -        FileReader gameContent = new FileReader(game);
    1.24 +        Reader gameContent = new InputStreamReader(new FileInputStream(game), "UTF-8");
    1.25          int len = gameContent.read(arr);
    1.26          String content = new String(arr, 0, len);
    1.27          return content;