Open GoogleCodeExporter opened 8 years ago
Actually, the code I attached is still doing more work than needed. If the
StringBuilder is passed in to the encodeCharacter method, then String.valueOf()
is unnecessary and overkill. The Character should be passed directly in to the
StringBuilder. For example:
public StringBuilder encodeCharacterAndAppend(StringBuilder sb, char[] immune, Character c ) {
// check for immune characters
if ( containsCharacter(c, immune ) ) {
return sb.append(c);
}
// check for alphanumeric characters
String hex = Codec.getHexForNonAlphanumeric(c);
if ( hex == null ) {
return sb.append(c);
}
I've uploaded the new HTMLEntityCode with this change.
Original comment by ebatz...@gmail.com
on 27 Jan 2011 at 12:27
Attachments:
Original comment by M.Gelma...@gmail.com
on 13 Nov 2014 at 6:13
Original issue reported on code.google.com by
ebatz...@gmail.com
on 27 Jan 2011 at 12:16Attachments: