Encode json in the zf1 way.