public String decode( String encodedText ) {
if (encodedText == null) return null;
if (encodedText.length() == 0) return encodedText;
final StringBuilder result = new StringBuilder();
final CharacterIterator iter = new StringCharacterIterator(encodedText);
for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
if (c == ESCAPE_CHARACTER) {
boolean foundEscapedCharacter = false;
// Found the first character in a potential escape sequence, so grab the next two characters ...
char hexChar1 = iter.next();
char hexChar2 = hexChar1 != CharacterIterator.DONE ? iter.next() : CharacterIterator.DONE;