Issue
I want to make a program that will run in any (or at least most of) X11 based GUI systems, no matter if it is KDE, Gnome, Xfce, etc. So, I concluded I have to write it using only X11 functions. Unfortunately I found out X11 doesn't support UTF-8 encoding.
All I want now is to somehow display to the end user a message box when my program crashes and there is no way to use any higher level GUI system.
I heard about some console applications like "zenity" and "kdialog". However I can't use them because I've no guarantee any of them will be available (my distro, for one, has got no such software installed by default)
Solution
There are two possible solutions to your problem.
Either via
Xutf8DrawString
(see here or here)
or if by any chance the macro X_HAVE_UTF8_STRING
is not present, then you have to convert the multibyte sequence into a two byte sequence (example can be found here) and draw the string with XDrawText16 or XDrawString16.
See also: Core Font subsystem
Answered By - Erdal Küçük Answer Checked By - Marilyn (WPSolving Volunteer)