This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 10870
  libX11 doesn't understand C.UTF-8 locale Last modified: 2009-11-12 18:24:43
     Query page      Enter new bug
Bug#: 10870   Hardware:   Reporter: Jon TURNEY <jon.turney@dronecode.org.uk>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Status: RESOLVED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: Cygwin/X maintainer <yselkowitz@cygwin.com>   Target Milestone:  
Summary:
Keywords:

Attachment Description Type Created Actions
locale.patch Patch for appying to /usr/share/X11/locale to add C.UTF-8 to locales libX11 knows about patch 2009-10-29 18:25 Edit | Diff
0001-Add-C.UTF-8-to-libX11-locales.patch Corresponding source patch patch 2009-10-29 18:26 Edit | Diff
0001-Cygwin-X-XSupportsLocale-failure-is-non-critical.patch XServer patch to make XSupportsLocale failure non-critical patch 2009-10-29 19:00 Edit | Diff
0001-Cygwin-X-Don-t-crash-if-conversion-of-window-name-to.patch Don't crash if conversion of window name to UTF-8 fails patch 2009-11-10 02:10 Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 10870 depends on: Show dependency tree
Show dependency graph
Bug 10870 blocks:

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2009-10-29 18:21
http://cygwin.com/ml/cygwin-xfree/2009-10/msg00106.html

libX11 doesn't understand about the C.UTF-8 locale, so XSupportsLocale() fails
in that locale.

Ordinarily this wouldn't be a problem, although applications will typically
complain that "Warning: locale not supported by C library, locale unchanged"

Unfortunately the server considers it a fatal error if XSupportsLocale() fails
for internal clients.  This is probably wrong.

------- Additional Comment #1 From Jon TURNEY 2009-10-29 18:25 -------
Created an attachment (id=4340)
Patch for appying to /usr/share/X11/locale to add C.UTF-8 to locales libX11
knows about

------- Additional Comment #2 From Jon TURNEY 2009-10-29 18:26 -------
Created an attachment (id=4341)
Corresponding source patch

------- Additional Comment #3 From Jon TURNEY 2009-10-29 19:00 -------
Created an attachment (id=4342)
XServer patch to make XSupportsLocale failure non-critical

------- Additional Comment #4 From Cygwin/X maintainer 2009-11-03 19:37 -------
(In reply to comment #3)
> Created an attachment (id=4342)
> XServer patch to make XSupportsLocale failure non-critical

With cygwin 1.7.0-63 out, I think we need to push this quickly.

Patch added to the queue for 1.7.1-2.

------- Additional Comment #5 From Cygwin/X maintainer 2009-11-03 19:42 -------
(In reply to comment #2)
> Created an attachment (id=4341)
> Corresponding source patch

Thanks for the patch.  What I don't understand is, if this C.UTF-8 locale is
Debian's idea, why doesn't there libX11 have a similar patch[1]?

[1] http://patch-tracker.debian.org/package/libx11/2:1.3-1

------- Additional Comment #6 From Jon TURNEY 2009-11-03 19:48 -------
(In reply to comment #5)
> (In reply to comment #2)
> > Created an attachment (id=4341)
> > Corresponding source patch
> 
> Thanks for the patch.  What I don't understand is, if this C.UTF-8 locale is
> Debian's idea, why doesn't there libX11 have a similar patch[1]?
> 
> [1] http://patch-tracker.debian.org/package/libx11/2:1.3-1

I don't know. Possibly because no-one actually runs their system in C.UTF-8.  It
looks like the idea is that C.UTF-8 is only intended for use in things like
build environments which require a language-neutral but UTF-8 aware locale.


------- Additional Comment #7 From Cygwin/X maintainer 2009-11-09 19:14 -------
Server patch shipped in 1.7.1-2.  I saw there was some further discussion about
the xlib part of this patch; what was your conclusion?

------- Additional Comment #8 From Jon TURNEY 2009-11-09 22:36 -------
(In reply to comment #7)
> Server patch shipped in 1.7.1-2.  I saw there was some further discussion about
> the xlib part of this patch; what was your conclusion?

I think the xlib changes are ok to publish.  But there still some other odd
behaviour being reported which I guess is due to no longer building with X_LOCALE.

------- Additional Comment #9 From Jon TURNEY 2009-11-10 02:10 -------
Created an attachment (id=4376)
Don't crash if conversion of window name to UTF-8 fails

This fixes the crash, but windows just end up with blank titles.

There's a deeper problem that Xlib doesn't seem to know how to convert strings
to C.UTF-8 locale encoding (although this should be pretty trivial) :-)

------- Additional Comment #10 From Jon TURNEY 2009-11-10 14:06 -------
(In reply to comment #9)
> Created an attachment (id=4376)
> Don't crash if conversion of window name to UTF-8 fails
> 
> This fixes the crash, but windows just end up with blank titles.
> 
> There's a deeper problem that Xlib doesn't seem to know how to convert strings
> to C.UTF-8 locale encoding (although this should be pretty trivial) :-)

Doh! I'd reverted the Xlib locale data patch. With that present, the window
titles get converted correctly.

So that seems pretty clear that both parts are actually needed :-)

Perhaps the Xserver could be a bit smarter about fallbacks when trying to
convert window titles and clipboard strings to the locale encoding, but I'm not
sure how...

------- Additional Comment #11 From Cygwin/X maintainer 2009-11-12 01:20 -------
(In reply to comment #9)
> Created an attachment (id=4376)
> Don't crash if conversion of window name to UTF-8 fails

Patch added to queue for 1.7.1-3.

FYI, this didn't apply cleanly to 1.7.1 due to whitespace alignment differences,
so the patch in SVN is slightly different to compensate.

------- Additional Comment #12 From Cygwin/X maintainer 2009-11-12 18:24 -------
Second patch for xserver shipped in 1.7.1-3.
Patch for xlib shipped in 1.3.2-2.
Closing.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In