Added encoder for encoding strings in JSON format