add encoding and template-encoding attributes
add test for character encoding attributes