Blob b;
String b64;
String strUrlUTF8;
String strOriginal;
strOriginal = 'Joe’s CafĂ© & Bar ♫';
System.debug('String strOriginal: [' + strOriginal + ']');
strUrlUTF8 = EncodingUtil.urlEncode(strOriginal, 'UTF-8');
System.debug('String strUrlUTF8: [' + strUrlUTF8 + ']');
b = Blob.valueOf(strUrlUTF8);
System.debug('Blob b: [' + b.toString() + ']');
b64 = EncodingUtil.base64Encode(b);
System.debug('String b64: [' + b64 + ']');
b = EncodingUtil.base64Decode(b64);
System.debug('Blob b: [' + b.toString() + ']');
strUrlUTF8 = b.toString();
System.debug('String strUrlUTF8: [' + strUrlUTF8 + ']');
strOriginal = EncodingUtil.urlDecode(strUrlUTF8, 'UTF-8');
System.debug('String strOriginal: [' + strOriginal + ']');
String b64;
String strUrlUTF8;
String strOriginal;
strOriginal = 'Joe’s CafĂ© & Bar ♫';
System.debug('String strOriginal: [' + strOriginal + ']');
strUrlUTF8 = EncodingUtil.urlEncode(strOriginal, 'UTF-8');
System.debug('String strUrlUTF8: [' + strUrlUTF8 + ']');
b = Blob.valueOf(strUrlUTF8);
System.debug('Blob b: [' + b.toString() + ']');
b64 = EncodingUtil.base64Encode(b);
System.debug('String b64: [' + b64 + ']');
b = EncodingUtil.base64Decode(b64);
System.debug('Blob b: [' + b.toString() + ']');
strUrlUTF8 = b.toString();
System.debug('String strUrlUTF8: [' + strUrlUTF8 + ']');
strOriginal = EncodingUtil.urlDecode(strUrlUTF8, 'UTF-8');
System.debug('String strOriginal: [' + strOriginal + ']');
No comments :
Post a Comment