Add data attribute for encoding

Mirrors the grammar data attribute