Skip to content

Commit

Permalink
bugfix for last commit
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4142 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
fuchsi committed Oct 4, 2007
1 parent 33fb2f7 commit c0f5fc5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/de/anomic/data/htmlTools.java
Expand Up @@ -43,18 +43,19 @@ public static String encodeUnicode2xml(String text) {
*/
public static String encode(String text, final String[] map, int spos, int epos) {
StringBuffer sb = new StringBuffer(text.length());
search: while (spos < text.length()) {
int textpos = 0;
search: while (textpos < text.length()) {
// find a (forward) mapping
loop: for (int i = spos; i < epos; i += 2) {
if (text.charAt(spos) != map[i].charAt(0)) continue loop;
if (text.charAt(textpos) != map[i].charAt(0)) continue loop;
// found match
sb.append(map[i + 1]);
spos++;
textpos++;
continue search;
}
// not found match
sb.append(text.charAt(spos));
spos++;
textpos++;
}

return sb.toString();
Expand Down

0 comments on commit c0f5fc5

Please sign in to comment.