pyglet: xlib issue: Could not create UTF8 text property

There is a well known issue possibly occurring on some systems but not others, where the xlib integration code may bail out, coming from this line of code. The workaround suggested is changing the system-wide locale or setting the environment LANG variable to en_US, however it would be nice if other locales worked too, such that this environment tweak is not necessary. If xlib is friendly enough to allow and I understand the issue correctly.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Great! Thanks again for your help on this.

I suppose we can close this now, as the fix will be in the next point release.

Yes, I meant changing the LANG variable outside Python. I ran LANG=en_US python test.py which worked.

Can you check if setting the LANG environment variable to either of the following work instead?

This throws the same error pyglet.window.xlib.XlibException: Could not create UTF8 text property

Also, I just wanted to confirm, you mean en_IN.UTF8 / en_IN.utf8 right?

Can you check if setting the LANG environment variable to either of the following work instead? 1. in_EN.UTF-8 2. in_EN.utf8

I am facing the same issue. Changing LANG to en_US fixes it

I tested this on a new venv with only pyglet installed, simply ran

import pyglet
window = pyglet.window.Window()

image LC_TYPE and LC_ALL env vars are not set.