Added support for UTF-8 (including double-width) texts in dialogs.