#JC-1640 added  function to encode url