1 /* input-method-xfs.c provides just only locale initialize
2 for non Motif people. (stoled from input-method-xlib.c)
3 Why I made this code is to initialize X locale environment for
4 the purpose of use XFontSet correctly in lwlib/xlwmenu.c.
5 And this code donot provides input methods under Xlib while they
6 prefer to use Canna, Wnn, skk or something like that.
7 This code has been tested on FreeBSD 2.2.1 and Solaris2.5.
9 Copyright (C) 1997 Kazuyuki IENAGA.
11 This file is a part of XEmacs.
13 XEmacs is free software; you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by the
15 Free Software Foundation; either version 2, or (at your option) any
18 XEmacs is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 You should have received a copy of the GNU General Public License
24 along with XEmacs; see the file COPYING. If not, write to
25 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. */
29 #include <X11/Xlocale.h> /* More portable than <locale.h> ? */
35 #include "console-x.h"
36 #include "EmacsFrame.h"
41 Initialize_Locale (void)
45 /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc
46 routine calls setlocale(LC_ALL, lang) which fucks up our lower-level
47 locale management, and especially the value of LC_NUMERIC. Anyway, since
48 at this point, we don't know yet whether we're gonna need an X11 frame,
49 we should really do it manually and not use Xlib's dumb default routine */
50 /*XtSetLanguageProc (NULL, (XtLanguageProc) NULL, NULL);*/
51 if ((locale = setlocale (LC_ALL, "")) == NULL)
53 stderr_out ("Can't set locale.\n");
54 stderr_out ("Using C locale instead.\n");
57 if ((locale = setlocale (LC_ALL, "C")) == NULL)
59 stderr_out ("Can't even set locale to `C'!\n");
64 if (!XSupportsLocale ())
66 stderr_out ("X Windows does not support locale `%s'\n", locale);
67 stderr_out ("Using C Locale instead\n");
70 if ((locale = setlocale (LC_ALL, "C")) == NULL)
72 stderr_out ("Can't even set locale to `C'!\n");
75 if (!XSupportsLocale ())
77 stderr_out ("X Windows does not even support locale `C'!\n");
82 setlocale(LC_NUMERIC, "C");
83 setlocale(LC_CTYPE, ""); /* take back CTYPE to previous state */
85 if (XSetLocaleModifiers ("") == NULL)
87 stderr_out ("XSetLocaleModifiers(\"\") failed\n");
88 stderr_out ("Check the value of the XMODIFIERS environment variable.\n");
91 #endif /* USE_XFONTSET */