try {
encodedValue = new Base64().encode(value.getBytes(encoding));
} catch (UnsupportedEncodingException e) {
String msg = "Unsupported Encoding";
log.error(msg, e);
throw new FunctionCallException(msg, e);
}
String encodedString;
try {
encodedString = new String(encodedValue, encoding);
} catch (UnsupportedEncodingException e) {
String msg = "Unsupported Encoding";
log.error(msg, e);
throw new FunctionCallException(msg, e);
}
if (debugOn) {
log.debug("Converted string: " + value + " with encoding: " + encoding +
" to base64 encoded value: " + encodedString);