Added configurable encoding