handle nbsp entity

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@758 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-08-25 06:48:00 +00:00
parent b9fda5fd27
commit 6cf1f652c3

View file

@ -247,7 +247,7 @@ public final class ParserUtils
}
}
private static final Pattern P_ENTITY = Pattern.compile("&(?:#(x[\\da-f]+|\\d+)|(amp|quot|apos|szlig));");
private static final Pattern P_ENTITY = Pattern.compile("&(?:#(x[\\da-f]+|\\d+)|(amp|quot|apos|szlig|nbsp));");
public static String resolveEntities(final CharSequence str)
{
@ -279,6 +279,8 @@ public final class ParserUtils
c = '\'';
else if (namedEntity.equals("szlig"))
c = 'ß';
else if (namedEntity.equals("nbsp"))
c = ' ';
else
throw new IllegalStateException("unknown entity: " + namedEntity);
}