Fix space encoding when serializing JSON to form fields