use HTML5 text encoder/decoder if available