This is an exact duplicate of this question; however the code linked in the accepted answer is nearly 11 years old, and this comment in the code leads to my duplicate questi
Is there a simple function in X11/Xlib that will map a KeySym to its Unicode equivalent?
The definitive answer is no
Because Unicode was invented years after Xlib and no one ever went back to add such a thing? Most of the Xlib API is codeset independent since it was written in the days when every locale used a different character set (ISO 8859-*, Big5, JIS, etc.), so you get a char buffer appropriate to the current locale. There were a few UTF-8 specific additions in later years, but mostly we've been trying to let Xlib rest in peace since then, pushing new API design towards xcb instead.