Add support for configurable message text encoding

This makes it possible to support character sets where glyphs cross
byte boundaries. Defaults to UTF-8.