Search code examples
liferaydecodevelocityutf8-decodeliferay-velocity

Decoding html encoded character in velocity liferay


As title, I have an encoded String that I got from my URL, I want to display to user but don't know how to decode it

T%E1%BB%87p t%E1%BA%A3i l%C3%AAn => Tệp tải lên

I'm using liferay 6.1 ga1, and try to create some webcontent template.


Solution

  • You can try with httpUtil, that should be available in velocity context.

    $httpUtil.decodeURL("T%E1%BB%87p t%E1%BA%A3i l%C3%AAn")
    

    would get you Tệp tải lên