In php rawurlencode
function escape the invalid character. For example,
<?php
$str = '{"1":{"id":"some_id","xyz":"1","date":"1397287235418","type":"67878"}}';
$str2 = rawurlencode($str);
?>
<a href="/data/<?php echo $str2; ?>">LINK</a>
This shows the url
http://example.com/data/%7B%221%22%3A%7B%22id%22%3A%22some_id%22%2C%22xyz%22%3A%221%22%2C%22date%22%3A%221397287235418%22%2C%22type%22%3A%2267878%22%7D%7D/