You need to sign in to do that
Don't have an account?
Patcs_1
HTML DECODE function in Apex class
Hi
any body knows how to decode the HTML code into text in apex class.
Let me explain my scenario, I have a api call from external system, In that api call they are encoding the scepical charaters it looks like below.
"firstName": "Ришат",
"lastName": "Гатаулин",
I want to decode this character in to text and store the values in contact object. Currently it is storing with this character. It is not decoding the character.
does anybody have solutions for this.
Thanks in Advance!
any body knows how to decode the HTML code into text in apex class.
Let me explain my scenario, I have a api call from external system, In that api call they are encoding the scepical charaters it looks like below.
"firstName": "Ришат",
"lastName": "Гатаулин",
I want to decode this character in to text and store the values in contact object. Currently it is storing with this character. It is not decoding the character.
does anybody have solutions for this.
Thanks in Advance!
Thanks for your reply. I found the answer.
to decode the HTML character in Apex class
we have to use unescapeHtml4()
example :
string str ="Ришат";
string decode = str.unescapeHtml4();
All Answers
Check the link below
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_encodingUtil.htm
I believe what you're looking for is EncodingUtil.urlEncode().
Thanks for your reply. I found the answer.
to decode the HTML character in Apex class
we have to use unescapeHtml4()
example :
string str ="Ришат";
string decode = str.unescapeHtml4();