JSON encoding should do it