refactor to use new codec interfaces
remove call to HTMLCodec.shouldEncode