Added support for extension encoding to json