Move utf8 text handling to callbacks