private String unicodeToPlain(String source, Boolean uppercase, String postchars) {
        String plainResult = "";

        Integer srcLen = source.length();
        String hex = "";
        int j;

        // Cycles through encoded text. Finds all instances of %XX and converts them
        // to the plain text equivalent.
        if (srcLen > 0) {

            for (int i = 0; i < srcLen; i++) {
                // Trailing characters present.
                if (postchars.length() > 0) {
                    if (source.charAt(i) == '%') {
                        hex = source.substring(i + 1, i + 2) + source.substring(i + 2, i + 3);
                        i = i + 2 + postchars.length();
                        plainResult += unescape(hex);
                    } else {
                        plainResult += source.charAt(i);
                    }
                // No trailing characters present.
                } else {
                    if (source.charAt(i) == '%') {
                        j = i + 2;
                        hex = "";
                        while ((source.charAt(j) != '%') && (j < srcLen - 1)) {
                            hex += source.substring(j, j + 1);
                            j++;
                        }
                        if (j == srcLen - 1) {
                            hex += source.substring(j, j + 1);
                            j++;
                        }
                        i = j - 1;
                        plainResult += unescape(hex);
                    } else {
                        plainResult += source.charAt(i);
                    }
                }
            }
        }
        return plainResult;
    }