custom json encoder to support sets and internationalized text