I don't really see a reason to use raw2js, unless I'm dealing with an array of values to encode. json_encode achieves the solution in a more robust way, with less code.