Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8594e952 authored by Diego Perez's avatar Diego Perez
Browse files

Do not set default encoding to UTF-8 in KXmlParser

Manually setting the encoding makes kxml to ignore the BOM at the
beginning of the file and fail to parse some files. If null is passed,
kxml will check if there is a BOM and default to UTF-8 if there is none.

Bug: http://b.android.com/38055
Change-Id: I170d8fbb7567d2266f36a7768d4e63d9c2fa8286
(cherry picked from commit 89a5812b9eb8c62411a88f472468f3c978b8cfcd)
parent 4a1bd499
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ public class ParserFactory {

    public final static boolean LOG_PARSER = false;

    private final static String ENCODING = "UTF-8"; //$NON-NLS-1$

    // Used to get a new XmlPullParser from the client.
    @Nullable
    private static com.android.ide.common.rendering.api.ParserFactory sParserFactory;
@@ -74,7 +72,7 @@ public class ParserFactory {

        stream = readAndClose(stream, name, size);

        parser.setInput(stream, ENCODING);
        parser.setInput(stream, null);
        if (isLayout) {
            try {
                return new LayoutParserWrapper(parser).peekTillLayoutStart();