package org.hisp.dhis.android.core.data.file;

import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public final class ResourcesFileReader implements IFileReader {
    @Override
    public String getStringFromFile(String filename) throws IOException {
        InputStream fileStream = this.getClass().getClassLoader().getResourceAsStream(filename);
        Scanner scanner = new java.util.Scanner(fileStream).useDelimiter("\\A");
        return scanner.hasNext() ? scanner.next() : "";
    }
}


@@ -40,16 +40,47 @@
 .file;%0A%0A
+import java.io.BufferedReader;%0A
 import j
@@ -139,28 +139,134 @@
 rt java.
-util.Scanner
+io.InputStreamReader;%0Aimport java.io.Reader;%0Aimport java.nio.charset.Charset;%0Aimport java.nio.charset.StandardCharsets
 ;%0A%0Apubli
@@ -509,16 +509,17 @@
 ename);%0A
+%0A
         
@@ -523,134 +523,382 @@
    S
-canner scanner = new java.util.Scanner(fileStream).useDelimiter(%22%5C%5CA%22);%0A        return scanner.hasNext() ? scanner.next() : %22%22
+tringBuilder textBuilder = new StringBuilder();%0A        try (Reader reader = new BufferedReader(new InputStreamReader%0A                (fileStream, Charset.forName(StandardCharsets.UTF_8.name())))) %7B%0A            int c;%0A            while ((c = reader.read()) != -1) %7B%0A                textBuilder.append((char) c);%0A            %7D%0A        %7D%0A%0A        return textBuilder.toString()
 ;%0A  

Change ResourcesFileReader implementation