You need to sign in to do that
Don't have an account?
saurabhgupta
need to convert a document in 8 bit ASCII Format
Hi
I m stuck in a code .Need some help
I have fired a Query on document and stored its body in a blob type variable 'BodyContent'
Document Doc =[Select Name, Id, Body From Document ];
System.debug('Doc' + Doc);
String FileName = Doc.Name;
BodyContent=Doc.Body;
Now I m converting this blob to string using TOString() method like this
String DocBody = bodyContent.toString();
but i need to convert this document or string in 8 bit ASCII format
How can i do this.
Can anyone help?
It seems to be a problem in salesforce, apparently theres isn't an easy way to solve this.
The most similar to a solution a could found is this post. I hope it helps
Ignacio.
Hi
The issue is resolved
this can be done as follows:
String Docbody = EncodingUtil.base64Encode(bodyContent);
Thanks