skip characters until the xml actually starts

This commit is contained in:
Athou
2013-05-02 08:59:47 +02:00
parent 5dcc923cf1
commit d31ba48507

View File

@@ -44,8 +44,19 @@ public class FeedUtils {
return null;
}
StringBuilder sb = new StringBuilder();
boolean firstTagFound = false;
for (int i = 0; i < xml.length(); i++) {
char c = xml.charAt(i);
if (!firstTagFound) {
if (c == '<') {
firstTagFound = true;
} else {
continue;
}
}
if (c >= 32 || c == 9 || c == 10 || c == 13) {
if (!Character.isHighSurrogate(c)
&& !Character.isLowSurrogate(c)) {