Index: gcalctool/display.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/display.c,v
retrieving revision 1.36
diff -u -r1.36 display.c
--- gcalctool/display.c	23 Dec 2003 14:21:12 -0000	1.36
+++ gcalctool/display.c	5 Jan 2004 17:34:12 -0000
@@ -1,7 +1,7 @@
 
 /*  $Header: /cvs/gnome/gcalctool/gcalctool/display.c,v 1.36 2003/12/23 14:21:12 richb Exp $
  *
- *  Copyright (c) 1987-2003 Sun Microsystems, Inc. All Rights Reserved.
+ *  Copyright (c) 1987-2004 Sun Microsystems, Inc. All Rights Reserved.
  *           
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -83,13 +83,8 @@
     char *dstp = str;
     size_t tsep_len;
 
-/* If there are no thousands separators in the numeric string, just return
- * without doing anything. This is needed because the initial constant
- * definitions are potentially in read-only memory, and shouldn't be adjusted.
- */
-
-    if (strstr(str, v->tsep) != NULL) {
-        tsep_len = strlen(v->tsep);
+    tsep_len = strlen(v->tsep);
+    if (tsep_len && strstr(str, v->tsep) != NULL) {
         while (*srcp != '\0') {
             if (memcmp(srcp, v->tsep, tsep_len) == 0) {
                 srcp += tsep_len;
Index: gcalctool/get.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/get.c,v
retrieving revision 1.26
diff -u -r1.26 get.c
--- gcalctool/get.c	5 Jan 2004 16:56:12 -0000	1.26
+++ gcalctool/get.c	5 Jan 2004 17:34:12 -0000
@@ -128,7 +128,9 @@
     char *radix;
 
     setlocale(LC_NUMERIC, "");
-    radix = nl_langinfo(RADIXCHAR);
+    if ((radix = nl_langinfo(RADIXCHAR)) != NULL) {
+        radix = g_locale_to_utf8(radix, -1, NULL, NULL, NULL);
+    }
 
     if (radix == NULL || radix[0] == '\0') {
         return(".");
@@ -228,7 +230,9 @@
     char *tsep;
 
     setlocale(LC_NUMERIC, "");
-    tsep = nl_langinfo(THOUSEP);
+    if ((tsep = nl_langinfo(THOUSEP)) != NULL) {
+        tsep = g_locale_to_utf8(tsep, -1, NULL, NULL, NULL);
+    }
 
     if (tsep == NULL || tsep[0] == '\0') {
         return(",");
@@ -251,6 +255,7 @@
 void
 init_vars()    /* Setup default values for various variables. */
 {
+    char *loc_radix;
     int acc, i, n, size;
 
     v->accuracy      = 9;      /* Initial accuracy. */
@@ -274,6 +279,8 @@
 
     read_str(&v->iconlabel, _("calculator"));  /* Default icon label. */
 
+    loc_radix = (char *) v->radix;
+    v->radix = ".";
     init_constant(0, "0.621");                 /* kms/hr <=> miles/hr. */
     init_constant(1, "1.4142135623");          /* square root of 2 */
     init_constant(2, "2.7182818284");          /* e */
@@ -284,6 +291,7 @@
     init_constant(7, "0.0353");                /* grams <=> ounce. */
     init_constant(8, "0.948");                 /* Kjoules <=> BTU's. */
     init_constant(9, "0.0610");                /* cms3 <=> inches3. */
+    v->radix = loc_radix;
 
     n = 0;
     for (i = 0; i < MAXREGS; i++) {
