Bug 78804 - Xutf8LookupString fails in UTF-8 locale if X server lacks XKB support
Xutf8LookupString fails in UTF-8 locale if X server lacks XKB support
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
8.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
http://www.cl.cam.ac.uk/~mgk25/ucs/xe...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-30 15:42 EST by Markus Kuhn
Modified: 2007-04-18 12:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 05:27:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Xfree86 patch 5513 by Ivan Pascal <pascal@info.tsu.ru> (791 bytes, patch)
2002-12-06 10:28 EST, Markus Kuhn
no flags Details | Diff

  None (edit)
Description Markus Kuhn 2002-11-30 15:42:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

Description of problem:
Xutf8LookupString performs an unnecessary ISO 8859-1 -> UTF-8 translation,
thereby corrupting keyboard input data. This happens only if the X client runs
on Red Hat 8.0 in a UTF-8 locale *and* the X server does not have XKB activated,
is for example the case by default with the Solaris 5.8 X server.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Use an X server with XKB disabled
2. LC_ALL=en_GB.UTF-8 xterm (with correct ISO10646-1 fonts)
3. If you have no non-ASCII keysym on your keyboard (e.g., you have US
keyboard), then map with xmodmap a keysym such as adiaeresis) onto
a key and press it in the xterm.
	

Actual Results:  The application in the xterm receives the UTF-8 sequence for
the keystream as if it had been passed unnecessarily through a ISO 8859-1 ->
UTF-8 converter.

Expected Results:  The correct UTF-8 sequence should have been received and the
correct character appear on the screen (d).

Additional info:

This bug was located on 2002-11-29 by Ivan Pascal (pascal@info.tsu.ru),
explained the same day on the i18n@XFree86.Org mailing list and fixed in patch
number 5513 sent to XFree86.Org:

--- xc/lib/X11/XKB.c.orig	Fri Nov 29 11:13:59 2002
+++ xc/lib/X11/XKB.c		Fri Nov 29 11:16:16 2002
@@ -417,9 +417,10 @@
     unsigned	values;
 #endif
 {
-    if ((dpy->flags & XlibDisplayNoXkb) ||
-	(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
-	return False;
+	if (!dpy->xkb_info)
+	   XkbUseExtension(dpy,NULL,NULL);
+	if (!dpy->xkb_info)
+	   return 0;
     affect&= XkbLC_AllControls;
     dpy->xkb_info->xlib_ctrls&= ~affect;
     dpy->xkb_info->xlib_ctrls|= (affect&values);
@@ -434,9 +435,10 @@
     Display *	dpy;
 #endif
 {
-    if ((dpy->flags & XlibDisplayNoXkb) ||
-	(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
-	return 0;
+	if (!dpy->xkb_info)
+	   XkbUseExtension(dpy,NULL,NULL);
+	if (!dpy->xkb_info)
+	   return 0;
     return dpy->xkb_info->xlib_ctrls;
 }



For more information, see the thread "XFree86 Xutf8LookupString BUG with Solarix
X server" started by myself on 2002-11-28 on i18n@xfree86.org.
Comment 1 Mike A. Harris 2002-12-06 10:20:52 EST
Please attach the patch as a file attachment.  Cut and pasted patches
always get munged in bugzilla.
Comment 2 Mike A. Harris 2002-12-06 10:23:00 EST
Oh, I forgot to mention...   I'll put this into my next erratum for 8.0
which will be 4.2.1 based.

Thanks.
Comment 3 Markus Kuhn 2002-12-06 10:28:29 EST
Created attachment 87665 [details]
Xfree86 patch 5513 by Ivan Pascal <pascal@info.tsu.ru>
Comment 4 Mike A. Harris 2002-12-15 05:27:00 EST
Thanks Markus.  Patch applied to my 4.2.1-9.6 build.  Will be in
future erratum release.  This should probably be commited to the
xf-4_2-branch by someone with CVS write permission also.

Closing as ERRATA, as it will be public when errata is released.

Note You need to log in before you can comment on or make changes to this bug.