private String plainToUnicode(String source, Boolean uppercase, String postchars) {

        Integer inLength = 0;
        String prechars = "%u";
        String uniTemp = "";
        String uniResult = "";
        String strResult = "";

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

        // Cycle through each input character.
        if (srcLen > 0) {

            for (int i = 0; i < srcLen; i++) {
                inLength = Integer.toString(source.charAt(i), 16).length();

                if (inLength > 0) {
                    uniTemp = Integer.toHexString(source.charAt(i));

                    if (uppercase) {
                        prechars = prechars.toUpperCase();
                        uniTemp = uniTemp.toUpperCase();
                    }

                    if (inLength == 1) {
                        uniResult += prechars + "000" + uniTemp + postchars; // + delimiter;
                    } else if (inLength == 2) {
                        uniResult += prechars + "00" + uniTemp + postchars; // + delimiter;
                    } else if (inLength == 3) {
                        uniResult += prechars + "0" + uniTemp + postchars; // + delimiter;
                    } else if (inLength >= 4) {
                        uniResult += prechars + uniTemp + postchars; // + delimiter;
                    } else {
                        uniResult += " [" + source.charAt(i) + " Not Valid] "; // + delimiter;
                    }

                } else {
                    uniResult += " [" + source.charAt(i) + " Not Valid] "; // + delimiter;
                }
            }

            strResult = uniResult;

        }
        return strResult;
    }