From 8264ebdfb5d083ec6c907d1ce55012b011f99476 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Sun, 28 Sep 2003 03:11:18 +0000 Subject: [PATCH] do not escape for XML characters encoded with unicode equivalents git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2111 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/util/StringUtils.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/org/jivesoftware/smack/util/StringUtils.java b/source/org/jivesoftware/smack/util/StringUtils.java index 1afa35d1f..36b7b40b5 100644 --- a/source/org/jivesoftware/smack/util/StringUtils.java +++ b/source/org/jivesoftware/smack/util/StringUtils.java @@ -200,8 +200,16 @@ public class StringUtils { if (i > last) { out.append(input, last, i - last); } - last = i + 1; - out.append(AMP_ENCODE); + // Do nothing if the string is of the form ë (unicode value) + if (!(len > i + 5 + && input[i + 1] == '#' + && Character.isDigit(input[i + 2]) + && Character.isDigit(input[i + 3]) + && Character.isDigit(input[i + 4]) + && input[i + 5] == ';')) { + last = i + 1; + out.append(AMP_ENCODE); + } } else if (ch == '"') { if (i > last) {