OpenSolaris

Printable Version Enter a New Search
Bug ID 6715568
Synopsis XOpenIM fails for locale=C
State 11-Closed:Verified (Closed)
Category:Subcategory xserver:i18n
Keywords
Responsible Engineer Wei Xue
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_94
Fixed In snv_94
Release Fixed solaris_nevada(snv_94)
Related Bugs 6693458 , 6711636 , 6789424
Submit Date 17-June-2008
Last Update Date 7-August-2008
Description
XopenIM fails in Nevada builds
Compile and run this test program like, 
cc -o xtest xtest.c -lX11
./xtest C
to run this in C locale, it gives out
XOpenIM() failed

Works fine in S10U5 FCS
----------------------------------
#include        <stdio.h>
#include        <stdlib.h>
#include        <locale.h>
#include        "X11/Xlib.h"
#include        "X11/Xutil.h"
#include        "X11/Xresource.h"


int
main(int argc, char **argv)
{
XrmDatabase     db = NULL;
XIM             im = NULL;
Display         *display;

        if (argc != 2)
        {
         fprintf(stderr, "Usage: %s <locale>\n", argv[0]);
         exit(1);
        }

        if (!(display=XOpenDisplay(NULL)))
        {
         fprintf(stderr, "%s:  Can't open display\n", argv[0]);
         exit(1);
        }

        XrmInitialize();

        if (!setlocale(LC_CTYPE, argv[1]))
        {
         fprintf(stderr, "setlocale(LC_CTYPE, %s) failed\n", argv[1]);
         exit(1);
        }

        if (!XSupportsLocale())
        {
         fprintf(stderr, "Locale '%s' not supported\n", argv[1]);
         exit(1);
        }

        if (!XSetLocaleModifiers(""))
        {
         fprintf(stderr, "XSetLocaleModifiers() failed\n");
         exit(1);
        }


        if (!(db=XrmGetStringDatabase("")))
        {
         fprintf(stderr, "XrmGetStringDatabase() failed\n");
         exit(1);
        }


        if (!(im=XOpenIM(display, db, NULL, NULL)))
        {
         fprintf(stderr, "XOpenIM() failed\n");
         exit(1);
        }


        if (!(XCloseIM(im)))
        {
         fprintf(stderr, "XCloseIM() failed\n");
         exit(1);
        }


        return(0);
}
***Test Case***
run test program:
./xtest C
expected result: there is no error message:XOpenIM() failed
Work Around
Here is the work agroud for avoid this issue in C locale:
add 
"XIM     common/ximlocal _XimpLocalOpenIM        # XIM_open"
as first XIM objects in C/XI18N_OBJS.
Comments
N/A