Wrong behavior of Entities.unescape ----------------------------------- Key: LANG-313 URL: https://issues.apache.org/jira/browse/LANG-313 Project: Commons Lang Issue Type: Bug Affects Versions: 2.2, 2.1 Reporter: Thiago Souza Fix For: 2.3
Hi, There's seems to be a bug at Entities.unescape. Try for example StringEscapeUtils.unescapeHtml("& &"). It outputs "& &" instead of "& &". The problem is at this piece of code: if (entityValue == -1) { buf.append('&'); buf.append(entityName); buf.append(';'); } else { buf.append((char) (entityValue)); } i = semi; The method always skips to the next ";", even if it doesn't finds the entity value and then disregarding any entity that may be actually be referred inside. Regards, Thiago Souza -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]