Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#1824) ruleset data is in incompatible charsets
Home

[Freeciv-Dev] (PR#1824) ruleset data is in incompatible charsets

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Kenn.Munro@xxxxxxxxxxxxxx, jdwheeler42@xxxxxxxxx, jrg45@xxxxxxxxxxxxxxxxx, pawel@xxxxxxxxxxxxxxx
Cc: mrproper@xxxxxxxxxx, i-freeciv-1824@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#1824) ruleset data is in incompatible charsets
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Aug 2004 09:27:35 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=1824 >

> [jdorje - Mon Jul 19 02:23:11 2004]:
> 
> Here's an update of a patch implementing my design.
> 
> It works in all the cases I've thrown at it.  However I know there are
> some corner cases out there.  is_sane_name has to be fixed, for one thing.

People complained about how my patch "forces users to use latin1".

Well, that's supposed to be temporary.  This patch changes the default
data encoding to utf-8 and converts all the rulesets.  This just
requires one line of change to the code and running the conversion
script (from earlier in the ticket).  Of course the patch is 3x as big
and will quickly become outdated.  But whatever.

jason

Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.70
diff -u -r1.70 configure.ac
--- configure.ac        21 Aug 2004 16:20:25 -0000      1.70
+++ configure.ac        25 Aug 2004 16:20:48 -0000
@@ -325,6 +325,11 @@
      FTWL_LIBS=`sdl-config --libs`" -lpng "`freetype-config --libs`
 fi
 
+dnl Check for libiconv (which is usually included in glibc, but may be
+dnl distributed separately).
+AM_ICONV
+LIBS="$LIBS $LIBICONV"
+
 dnl Check and choose clients
 if test x$client != xno; then
 
Index: configure.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.in,v
retrieving revision 1.246
diff -u -r1.246 configure.in
--- configure.in        21 Aug 2004 16:20:25 -0000      1.246
+++ configure.in        25 Aug 2004 16:20:48 -0000
@@ -318,6 +318,11 @@
      FTWL_LIBS=`sdl-config --libs`" -lpng "`freetype-config --libs`
 fi
 
+dnl Check for libiconv (which is usually included in glibc, but may be
+dnl distributed separately).
+AM_ICONV
+LIBS="$LIBS $LIBICONV"
+
 dnl Check and choose clients
 if test x$client != xno; then
 
Index: client/civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.193
diff -u -r1.193 civclient.c
--- client/civclient.c  2 Aug 2004 23:19:35 -0000       1.193
+++ client/civclient.c  25 Aug 2004 16:20:49 -0000
@@ -21,7 +21,9 @@
 #include <time.h>
 
 #include "capstr.h"
+#include "dataio.h"
 #include "diptreaty.h"
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "idex.h"
@@ -91,6 +93,61 @@
  */
 bool turn_done_sent = FALSE;
 
+/**************************************************************************
+  Convert a text string from the internal to the data encoding, when it
+  is written to the network.
+**************************************************************************/
+static unsigned char *put_conv(const char *src, size_t *length)
+{
+  char *out = internal_to_data_string_malloc(src);
+
+  if (out) {
+    *length = strlen(out);
+    return out;
+  } else {
+    *length = 0;
+    return NULL;
+  }
+}
+
+/**************************************************************************
+  Convert a text string from the data to the internal encoding when it is
+  first read from the network.  Returns FALSE if the destination isn't
+  large enough or the source was bad.
+**************************************************************************/
+static bool get_conv(char *dst, size_t ndst,
+                    const unsigned char *src, size_t nsrc)
+{
+  char *out = data_to_internal_string_malloc(src);
+  bool ret = TRUE;
+  size_t len;
+
+  if (!out) {
+    dst[0] = '\0';
+    return FALSE;
+  }
+
+  len = strlen(out);
+  if (ndst > 0 && len >= ndst) {
+    ret = FALSE;
+    len = ndst - 1;
+  }
+
+  memcpy(dst, out, len);
+  dst[len] = '\0';
+  free(out);
+
+  return ret;
+}
+
+/**************************************************************************
+  Set up charsets for the client.
+**************************************************************************/
+static void charsets_init(void)
+{
+  dio_set_put_conv_callback(put_conv);
+  dio_set_get_conv_callback(get_conv);
+}
 
 /**************************************************************************
 ...
@@ -203,6 +260,7 @@
   conn_list_init(&game.game_connections);
 
   ui_init();
+  charsets_init();
   my_init_network();
   chatline_common_init();
   init_messages_where();
Index: client/gui-gtk/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
retrieving revision 1.150
diff -u -r1.150 gui_main.c
--- client/gui-gtk/gui_main.c   10 Jul 2004 18:48:18 -0000      1.150
+++ client/gui-gtk/gui_main.c   25 Aug 2004 16:20:49 -0000
@@ -31,6 +31,7 @@
 #include <unistd.h>
 #endif
 
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "government.h"
@@ -803,6 +804,7 @@
 **************************************************************************/
 void ui_init(void)
 {
+  init_character_encodings(NULL);
 }
 
 /**************************************************************************
Index: client/gui-gtk-2.0/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/connectdlg.c,v
retrieving revision 1.37
diff -u -r1.37 connectdlg.c
--- client/gui-gtk-2.0/connectdlg.c     29 May 2004 13:41:57 -0000      1.37
+++ client/gui-gtk-2.0/connectdlg.c     25 Aug 2004 16:20:49 -0000
@@ -260,12 +260,12 @@
       GtkTreeIter it;
       int i;
 
-      row[0] = ntoh_str(pserver->name);
-      row[1] = ntoh_str(pserver->port);
-      row[2] = ntoh_str(pserver->version);
-      row[3] = g_strdup(_(pserver->status));
-      row[4] = ntoh_str(pserver->players);
-      row[5] = ntoh_str(pserver->metastring);
+      row[0] = pserver->name;
+      row[1] = pserver->port;
+      row[2] = pserver->version;
+      row[3] = _(pserver->status);
+      row[4] = pserver->players;
+      row[5] = pserver->metastring;
 
       gtk_list_store_append(storelan, &it);
       gtk_list_store_set(storelan, &it,
@@ -1128,12 +1128,12 @@
     GtkTreeIter it;
     int i;
 
-    row[0] = ntoh_str(pserver->name);
-    row[1] = ntoh_str(pserver->port);
-    row[2] = ntoh_str(pserver->version);
-    row[3] = g_strdup(_(pserver->status));
-    row[4] = ntoh_str(pserver->players);
-    row[5] = ntoh_str(pserver->metastring);
+    row[0] = pserver->name;
+    row[1] = pserver->port;
+    row[2] = pserver->version;
+    row[3] = _(pserver->status);
+    row[4] = pserver->players;
+    row[5] = pserver->metastring;
 
     gtk_list_store_append(storemeta, &it);
     gtk_list_store_set(storemeta, &it,
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.74
diff -u -r1.74 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       10 Jul 2004 18:48:18 -0000      1.74
+++ client/gui-gtk-2.0/gui_main.c       25 Aug 2004 16:20:49 -0000
@@ -33,6 +33,7 @@
 #include <gdk/gdkkeysyms.h>
 
 #include "dataio.h"
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "government.h"
@@ -173,107 +174,13 @@
 static gint timer_callback(gpointer data);
 static gboolean show_conn_popup(GtkWidget *view, GdkEventButton *ev,
                                gpointer data);
-static char *network_charset = NULL;
-
-
-/**************************************************************************
-Network string charset conversion functions.
-**************************************************************************/
-gchar *ntoh_str(const gchar *netstr)
-{
-  return g_convert(netstr, -1, "UTF-8", network_charset, NULL, NULL, NULL);
-}
-
-/**************************************************************************
-...
-**************************************************************************/
-static unsigned char *put_conv(const char *src, size_t *length)
-{
-  gsize len;
-  gchar *out =
-    g_convert(src, -1, network_charset, "UTF-8", NULL, &len, NULL);
-
-  if (out) {
-    unsigned char *dst = fc_malloc(len + 1);
-
-    memcpy(dst, out, len);
-    g_free(out);
-    dst[len] = '\0';
-
-    *length = len;
-    return dst;
-  } else {
-    *length = 0;
-    return NULL;
-  }
-}
-
-/**************************************************************************
- Returns FALSE if the destination isn't large enough or the source was
- bad.
-**************************************************************************/
-static bool get_conv(char *dst, size_t ndst, const unsigned char *src,
-                    size_t nsrc)
-{
-  gsize len;                   /* length to copy, not including null */
-  gchar *out = g_convert(src, nsrc, "UTF-8", network_charset, NULL, &len, 
NULL);
-  bool ret = TRUE;
-
-  if (!out) {
-    dst[0] = '\0';
-    return FALSE;
-  }
-
-  if (ndst > 0 && len >= ndst) {
-    ret = FALSE;
-    len = ndst - 1;
-  }
-
-  memcpy(dst, out, len);
-  dst[len] = '\0';
-  g_free(out);
-
-  return ret;
-}
-
-/**************************************************************************
-Local log callback functions.
-**************************************************************************/
-static void fprintf_utf8(FILE *stream, const char *format, ...)
-{
-  va_list ap;
-  const gchar *charset;
-  gchar *s;
-
-  va_start(ap, format);
-  s = g_strdup_vprintf(format, ap);
-  va_end(ap);
-
-  if (!g_get_charset(&charset)) {
-    GError *error = NULL;
-    gchar  *s2;
-
-    s2 = g_convert(s, -1, charset, "UTF-8", NULL, NULL, &error);
-
-    if (error) {
-      fprintf(stream, "fprintf_utf8: %s\n", error->message);
-      g_error_free(error);
-    } else {
-      g_free(s);
-      s = s2;
-    }
-  }
-  fputs(s, stream);
-  fflush(stream);
-  g_free(s);
-}
 
 /**************************************************************************
 ...
 **************************************************************************/
 static void log_callback_utf8(int level, const char *message)
 {
-  fprintf_utf8(stderr, "%d: %s\n", level, message);
+  fc_fprintf(stderr, "%d: %s\n", level, message);
 }
 
 /**************************************************************************
@@ -283,7 +190,7 @@
 static void print_usage(const char *argv0)
 {
   /* add client-specific usage information here */
-  fprintf_utf8(stderr, _("Report bugs to <%s>.\n"), BUG_EMAIL_ADDRESS);
+  fc_fprintf(stderr, _("Report bugs to <%s>.\n"), BUG_EMAIL_ADDRESS);
 }
 
 /**************************************************************************
@@ -1020,33 +927,11 @@
 void ui_init(void)
 {
   gchar *s;
-  char *net_charset;
 
-#ifdef ENABLE_NLS
-  bind_textdomain_codeset(PACKAGE, "UTF-8");
-#endif
+  init_character_encodings("UTF-8");
 
   log_set_callback(log_callback_utf8);
 
-  /* set networking string conversion callbacks */
-  if ((net_charset = getenv("FREECIV_NETWORK_ENCODING"))) {
-    network_charset = mystrdup(net_charset);
-  } else {
-    const gchar *charset;
-
-    g_get_charset(&charset);
-
-    if (!strcmp(charset, "ANSI_X3.4-1968")
-       || !strcmp(charset, "ASCII")) {
-      charset = "ISO-8859-1";
-    }
-    
-    network_charset = mystrdup(charset);
-  }
-
-  dio_set_put_conv_callback(put_conv);
-  dio_set_get_conv_callback(get_conv);
-
   /* convert inputs */
   s = g_locale_to_utf8(user_name, -1, NULL, NULL, NULL);
   sz_strlcpy(user_name, s);
Index: client/gui-sdl/gui_iconv.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gui_iconv.c,v
retrieving revision 1.8
diff -u -r1.8 gui_iconv.c
--- client/gui-sdl/gui_iconv.c  7 Aug 2003 21:54:29 -0000       1.8
+++ client/gui-sdl/gui_iconv.c  25 Aug 2004 16:20:49 -0000
@@ -66,22 +66,6 @@
 }
 
 /**************************************************************************
-  Return the local charset encoding (which will be passed to iconv).
-**************************************************************************/
-static const char *get_local_encoding(void)
-{
-#ifdef HAVE_LIBCHARSET
-  return locale_charset();
-#else
-#  ifdef HAVE_LANGINFO_CODESET
-  return nl_langinfo(CODESET);
-#  else
-  return "";
-#  endif
-#endif
-}
-
-/**************************************************************************
   Convert string from local encoding (8 bit char) to
   display encoding (16 bit unicode) and resut put in pToUniString.
   if pToUniString == NULL then resulting string will be allocate automaticaly.
@@ -94,7 +78,7 @@
 {
   /* Start Parametrs */
   const char *pTocode = get_display_encoding();
-  const char *pFromcode = get_local_encoding();
+  const char *pFromcode = INTERNAL_ENCODING;
   const char *pStart = pFromString;
   size_t length = strlen(pFromString) + 1;
 
@@ -175,7 +159,7 @@
 {
   /* Start Parametrs */
   const char *pFromcode = get_display_encoding();
-  const char *pTocode = get_local_encoding();
+  const char *pTocode = INTERNAL_ENCODING;
   const char *pStart = (char *) pFromUniString;
   size_t ulength = (unistrlen(pFromUniString) + 1) * 2;
 
Index: client/gui-sdl/gui_iconv.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gui_iconv.h,v
retrieving revision 1.5
diff -u -r1.5 gui_iconv.h
--- client/gui-sdl/gui_iconv.h  7 Aug 2003 21:54:29 -0000       1.5
+++ client/gui-sdl/gui_iconv.h  25 Aug 2004 16:20:49 -0000
@@ -26,6 +26,10 @@
 #ifndef FC__GUI_ICONV_H
 #define FC__GUI_ICONV_H
 
+/* The encoding used internally by the client (outside of the GUI code).
+ * This must be a single-width encoding. */
+#define INTERNAL_ENCODING "UTF-8"
+
 Uint16 *convertcopy_to_utf16(Uint16 *pToUniString, size_t ulenght,
                              const char *pFromString);
 char *convertcopy_to_chars(char *pToString, size_t lenght,
Index: client/gui-sdl/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gui_main.c,v
retrieving revision 1.44
diff -u -r1.44 gui_main.c
--- client/gui-sdl/gui_main.c   24 Jan 2004 02:58:55 -0000      1.44
+++ client/gui-sdl/gui_main.c   25 Aug 2004 16:20:49 -0000
@@ -698,6 +698,8 @@
   SDL_Surface *pBgd, *pTmp;
   Uint32 iSDL_Flags;
 
+  init_character_encodings(INTERNAL_ENCODING);
+
   SDL_Client_Flags = 0;
   iSDL_Flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
   
Index: client/gui-win32/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/gui_main.c,v
retrieving revision 1.28
diff -u -r1.28 gui_main.c
--- client/gui-win32/gui_main.c 21 Aug 2004 16:07:49 -0000      1.28
+++ client/gui-win32/gui_main.c 25 Aug 2004 16:20:50 -0000
@@ -21,6 +21,7 @@
 #include <commctrl.h>
 #include <richedit.h>
 
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "log.h"
@@ -529,6 +530,7 @@
 **************************************************************************/
 void ui_init(void)
 {
+  init_character_encodings(NULL);
 }
 
 /**************************************************************************
Index: client/gui-xaw/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/gui_main.c,v
retrieving revision 1.92
diff -u -r1.92 gui_main.c
--- client/gui-xaw/gui_main.c   6 Jun 2004 06:00:09 -0000       1.92
+++ client/gui-xaw/gui_main.c   25 Aug 2004 16:20:50 -0000
@@ -37,6 +37,7 @@
 #include "canvas.h"
 #include "pixcomm.h"
 
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "government.h"
@@ -261,6 +262,7 @@
 **************************************************************************/
 void ui_init(void)
 {
+  init_character_encodings(NULL);
 }
 
 /**************************************************************************
Index: data/nation/afghani.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/afghani.ruleset,v
retrieving revision 1.3
diff -u -r1.3 afghani.ruleset
--- data/nation/afghani.ruleset 24 Jul 2004 12:26:06 -0000      1.3
+++ data/nation/afghani.ruleset 25 Aug 2004 16:20:50 -0000
@@ -26,4 +26,4 @@
   "Maimana", "Gardes", "Andkhui", "Feyzabad", "Charikar", "Farah",
   "Deshu", "Kang", "Girishk", "Sar-i-Pol", "Taloqan", "Ab Gach",
   "Qalat", "Qal'eh-ye Now", "Sheberghan", "Kholm", "Samangan",
-  "Mahmud-e Raqi", "Asadabad", "Maydanshahr"
+  "Mahmud-e Raqi", "Asadabad", "Maydanshahr"
Index: data/nation/argentine.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/argentine.ruleset,v
retrieving revision 1.11
diff -u -r1.11 argentine.ruleset
--- data/nation/argentine.ruleset       24 Jul 2004 12:26:06 -0000      1.11
+++ data/nation/argentine.ruleset       25 Aug 2004 16:20:50 -0000
@@ -4,9 +4,9 @@
 plural=_("?plural:Argentines")
 class=_("Modern")
 legend=_("Argentina is located on the south-eastern coast of South America.")
-leader="José de San Martín", "Juan Manuel de Rosas", "Justo Urquiza",
-       "Bernardino Rivadavia", "Domingo Sarmiento", "Juan Domingo Perón",
-       "Eva Duarte de Perón", "Carlos Saúl Menem"
+leader="José de San Martín", "Juan Manuel de Rosas", "Justo Urquiza",
+       "Bernardino Rivadavia", "Domingo Sarmiento", "Juan Domingo Perón",
+       "Eva Duarte de Perón", "Carlos Saúl Menem"
 leader_sex="Male", "Male", "Male",
            "Male", "Male", "Male",
            "Female", "Male"
@@ -25,27 +25,27 @@
 
 cities =
   "Buenos Aires", "Mar del Plata (ocean)", "Rosario", "La Plata",
-  "Paraná", "Santa Fe", "Corrientes (river)", "Resistencia", "Salta",
-  "Córdoba", "San Miguel de Tucumán",
+  "Paraná", "Santa Fe", "Corrientes (river)", "Resistencia", "Salta",
+  "Córdoba", "San Miguel de Tucumán",
   "Santiago del Estero (swamp, !mountains)", "San Juan", "Mendoza",
-  "Bahía Blanca (ocean)", "San Salvador de Jujuy", "Formosa",
-  "Catamarca", "San Luis", "Río Cuarto (river)", "Villa María",
-  "San Nicolás de los arroyos (river)", "Zárate", "Junín",
+  "Bahía Blanca (ocean)", "San Salvador de Jujuy", "Formosa",
+  "Catamarca", "San Luis", "Río Cuarto (river)", "Villa María",
+  "San Nicolás de los arroyos (river)", "Zárate", "Junín",
   "Comodoro Rivadavia", "San Carlos de Bariloche", "Tandil", "Tartagal",
-  "Embarcación (river)", "Libertador General San Martín",
-  "San Antonio de los Cobres", "Metán", "Rosario de la Frontera",
-  "Las Lomitas", "Campo Gallo", "Tintina", "Andalgalá", "Tinogasta",
-  "Añatuya", "Pinto", "Tostado", "Santo Tomé", "Mercedes", "Albardón",
-  "Quilmes", "San Rafael", "General Alvear", "Malargüe", "Zapala",
-  "Neuquén", "General Roca", "Venado Tuerto", "Rufino", "Pergamino",
-  "Ibicuy", "Maipú", "Chascomús", "Dolores", "Las Flores", "Balcarce",
-  "Necochea", "25 de Mayo", "9 de Julio", "Olavarría", "Coronel Suárez",
+  "Embarcación (river)", "Libertador General San Martín",
+  "San Antonio de los Cobres", "Metán", "Rosario de la Frontera",
+  "Las Lomitas", "Campo Gallo", "Tintina", "Andalgalá", "Tinogasta",
+  "Añatuya", "Pinto", "Tostado", "Santo Tomé", "Mercedes", "Albardón",
+  "Quilmes", "San Rafael", "General Alvear", "Malargüe", "Zapala",
+  "Neuquén", "General Roca", "Venado Tuerto", "Rufino", "Pergamino",
+  "Ibicuy", "Maipú", "Chascomús", "Dolores", "Las Flores", "Balcarce",
+  "Necochea", "25 de Mayo", "9 de Julio", "Olavarría", "Coronel Suárez",
   "Coronel Pringles", "Tres Arroyos (river)", "Punta Alta", 
-  "General Acha", "Río Colorado (river)", "San Cristóbal",
+  "General Acha", "Río Colorado (river)", "San Cristóbal",
   "Santa Isabel", "Pehuajo", "Viedma", "Maquinchao", "Esquel",
-  "Paso de indios", "Las Plumas", "Rawson", "Sarmiento", "San Julián",
+  "Paso de indios", "Las Plumas", "Rawson", "Sarmiento", "San Julián",
   "Perito Moreno", "Puerto Deseado (ocean)", "Santa Cruz",
-  "Río Gallegos (river)", "Río Grande (river)", "Ushuaia",
-  "Entre Ríos (river)", "Chimbas", "El Leoncito", "Lanús", "Morón",
+  "Río Gallegos (river)", "Río Grande (river)", "Ushuaia",
+  "Entre Ríos (river)", "Chimbas", "El Leoncito", "Lanús", "Morón",
   "San Lorenzo", "Teniente Matienzo", "Cruz del Eje", "San Pedro",
-  "Río Negro (river)", "Quequén", "Decepción", "Esperanza"
+  "Río Negro (river)", "Quequén", "Decepción", "Esperanza"
Index: data/nation/aztec.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/aztec.ruleset,v
retrieving revision 1.8
diff -u -r1.8 aztec.ruleset
--- data/nation/aztec.ruleset   24 Jul 2004 12:26:06 -0000      1.8
+++ data/nation/aztec.ruleset   25 Aug 2004 16:20:50 -0000
@@ -24,8 +24,8 @@
 
 cities =
   "Michoacan", "Axaca", "Tuxpan", "Metztitlan", "Otumba",
-  "Tlacopán", "Theotihucanán", "Tezcuco", "Jalapa", "Tlaxcala",
-  "Cholula", "Tenochtitlán", "Yopitzingo", "Teotitlán", "Theuantepec",
+  "Tlacopán", "Theotihucanán", "Tezcuco", "Jalapa", "Tlaxcala",
+  "Cholula", "Tenochtitlán", "Yopitzingo", "Teotitlán", "Theuantepec",
   "Chiauhtia", "Chapultepec", "Coatepec", "Ayotzinco", "Itzapalapa",
   "Iztapam", "Mitxcoac", "Tacubaya", "Tecamac", "Tepezinco",
-  "Ticomán", "Xaltocán", "Xicalango", "Zumpanco"
+  "Ticomán", "Xaltocán", "Xicalango", "Zumpanco"
Index: data/nation/bavarian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/bavarian.ruleset,v
retrieving revision 1.9
diff -u -r1.9 bavarian.ruleset
--- data/nation/bavarian.ruleset        24 Jul 2004 12:26:06 -0000      1.9
+++ data/nation/bavarian.ruleset        25 Aug 2004 16:20:50 -0000
@@ -21,7 +21,7 @@
 civilwar_nations = "german"
 
 cities =
-  "München", "Regensburg", "Ingolstadt", "Landshut", "Rosenheim",
-  "Eichstätt", "Passau",  "Straubing", "Mühldorf", "Freising",
-  "Deggendorf", "Erding", "Freilassing", "Altötting", "Pfaffenhofen",
+  "München", "Regensburg", "Ingolstadt", "Landshut", "Rosenheim",
+  "Eichstätt", "Passau",  "Straubing", "Mühldorf", "Freising",
+  "Deggendorf", "Erding", "Freilassing", "Altötting", "Pfaffenhofen",
   "Vilshofen", "Plattling", "Traunstein", "Burghausen", "Dingolfing"
Index: data/nation/boer.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/boer.ruleset,v
retrieving revision 1.10
diff -u -r1.10 boer.ruleset
--- data/nation/boer.ruleset    24 Jul 2004 12:26:06 -0000      1.10
+++ data/nation/boer.ruleset    25 Aug 2004 16:20:51 -0000
@@ -8,7 +8,7 @@
 Transvaal and the Orange Free State, before being defeated by the British \
 in the war of 1899-1902.")
 leader= "Jacobus Pretorius", "Louis Botha", "Wessel Pretorius",
-       "Paulus Krüger", "Piet Retief", "Jan Smuts"
+       "Paulus Krüger", "Piet Retief", "Jan Smuts"
 leader_sex= "Male", "Male", "Male",
            "Male", "Male", "Male"
 flag="f.boer"
Index: data/nation/brazilian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/brazilian.ruleset,v
retrieving revision 1.12
diff -u -r1.12 brazilian.ruleset
--- data/nation/brazilian.ruleset       24 Jul 2004 12:26:06 -0000      1.12
+++ data/nation/brazilian.ruleset       25 Aug 2004 16:20:51 -0000
@@ -7,7 +7,7 @@
 independent in 1822AD. It is the only country in the New World that \
 has been the seat of a monarchy.")
 leader="Dom Pedro I", "Princesa Isabel", "Marechal Deodoro",
-       "Tancredo Neves", "Juscelino Kubitscheck", "Getúlio Vargas"
+       "Tancredo Neves", "Juscelino Kubitscheck", "Getúlio Vargas"
 leader_sex="Male", "Female", "Male", "Male", "Male", "Male"
 flag = "f.brasil"
 flag_alt = "-"
@@ -31,26 +31,26 @@
 civilwar_nations = "chilean"
 
 cities =
-    "São Paulo", "Rio de Janeiro (river)", "Salvador", "Fortaleza",
-    "Belo Horizonte", "Curitiba", "Recife (ocean)", "Belém", "Manaus",
-    "Brasília", "Porto Alegre (ocean)", "São Luís", "Campinas (grassland)",
-    "Natal", "Goiânia", "Maceió", "João Pessoa", "Teresina",
-    "São José dos Campos (grassland)", "Campo Grande (grassland)",
-    "Cuiabá", "Santos", "Ribeirão Preto (river)", "Niterói", "Olinda",
-    "Uberlândia", "Aracaju", "Feira de Santana", "Juiz de Fora",
-    "Joinville", "São Vicente", "Florianópolis", "Campos (grassland)",
-    "Jundiaí", "Campina Grande (grassland)", "Piracicaba", "Londrina",
-    "Serra (mountains)", "São José do Rio Preto (river)",
-    "Caxias do Sul", "Pelotas", "Vitória", "Franca", "Taubaté",
-    "Bauru", "Vila Velha", "Anápolis", "Petrópolis", "Limeira",
-    "Uberaba", "Blumenau", "Vitória da Conquista", "Macapá",
-    "Foz do Iguaçu (river)", "Porto Velho (ocean)", "Caruaru",
-    "Rio Branco (river)", "Maringá", "Santarém", "Ilhéus", "Mossoró",
+    "São Paulo", "Rio de Janeiro (river)", "Salvador", "Fortaleza",
+    "Belo Horizonte", "Curitiba", "Recife (ocean)", "Belém", "Manaus",
+    "Brasília", "Porto Alegre (ocean)", "São Luís", "Campinas (grassland)",
+    "Natal", "Goiânia", "Maceió", "João Pessoa", "Teresina",
+    "São José dos Campos (grassland)", "Campo Grande (grassland)",
+    "Cuiabá", "Santos", "Ribeirão Preto (river)", "Niterói", "Olinda",
+    "Uberlândia", "Aracaju", "Feira de Santana", "Juiz de Fora",
+    "Joinville", "São Vicente", "Florianópolis", "Campos (grassland)",
+    "Jundiaí", "Campina Grande (grassland)", "Piracicaba", "Londrina",
+    "Serra (mountains)", "São José do Rio Preto (river)",
+    "Caxias do Sul", "Pelotas", "Vitória", "Franca", "Taubaté",
+    "Bauru", "Vila Velha", "Anápolis", "Petrópolis", "Limeira",
+    "Uberaba", "Blumenau", "Vitória da Conquista", "Macapá",
+    "Foz do Iguaçu (river)", "Porto Velho (ocean)", "Caruaru",
+    "Rio Branco (river)", "Maringá", "Santarém", "Ilhéus", "Mossoró",
     "Governador Valadares", "Juazeiro do Norte", "Volta Redonda",
     "Araraquara", "Itabuna (hills)", "Boa Vista", "Petrolina",
-    "Presidente Prudente", "Divinópolis", "Itu", "Americana",
-    "Paranaguá", "Pindamonhangaba", "Cabo Frio (ocean)",
+    "Presidente Prudente", "Divinópolis", "Itu", "Americana",
+    "Paranaguá", "Pindamonhangaba", "Cabo Frio (ocean)",
     "Itapetininga (hills)", "Angra dos Reis (ocean)",
-    "Poços de Caldas", "Bragança Paulista", "Dourados", "Barbacena",
-    "Patos de Minas", "Rondonópolis", "Botucatu", "Varginha",
-    "Palmas", "Ouro Preto", "Teresópolis"
+    "Poços de Caldas", "Bragança Paulista", "Dourados", "Barbacena",
+    "Patos de Minas", "Rondonópolis", "Botucatu", "Varginha",
+    "Palmas", "Ouro Preto", "Teresópolis"
Index: data/nation/catalan.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/catalan.ruleset,v
retrieving revision 1.11
diff -u -r1.11 catalan.ruleset
--- data/nation/catalan.ruleset 24 Jul 2004 12:26:06 -0000      1.11
+++ data/nation/catalan.ruleset 25 Aug 2004 16:20:51 -0000
@@ -5,7 +5,7 @@
 class=_("Historical")
 legend=_("Catalunya (aka Catalonia in English) is the north-eastern-most \
 coastal region of Spain near the southern foot of the Pyrenees.")
-leader="Guifré el Pilós", "Ramon Berenguer IV", "Jaume I", "Pere II",
+leader="Guifré el Pilós", "Ramon Berenguer IV", "Jaume I", "Pere II",
        "Lluis Companys", "Josep Tarradellas"
 leader_sex="Male", "Male", "Male", "Male",
            "Male", "Male"
@@ -30,25 +30,25 @@
 civilwar_nations = "spanish", "portuguese"
 
 ; This city list does not actually correspond to medieval Catalonia,
-; but rather to the "Països Catalans" of modern ethnolinguistic
+; but rather to the "Països Catalans" of modern ethnolinguistic
 ; nationalists.
 cities =
-  "Barcelona", "Tarragona", "Lleida", "Girona", "Perpinyà", "Valencia",
+  "Barcelona", "Tarragona", "Lleida", "Girona", "Perpinyà", "Valencia",
   "Tolosa", "Ripoll", "Vic", "La Seu d'Urgell", "Cardona", "Tortosa",
   "Montserrat (hills)", "Poblet", "Santes Creus",
   "Vallbona de les Monges", "Balaguer", "Manresa", "Terrassa",
   "Sabadell", "Palma de Mallorca", "Eivissa", "Alacant", "Elx",
-  "Castelló de la Plana", "Montblanc (hills)", "Igualada", "Cervera",
-  "Berga", "Dénia", "Reus", "Granollers", "Mataró", "Figueres", "Olot",
-  "Badalona", "Tàrrega", "Amposta", "El Bruc", "Valls",
-  "Vilafranca del Penedés", "Manacor", "Alcúdia", "Sóller", "Artà",
+  "Castelló de la Plana", "Montblanc (hills)", "Igualada", "Cervera",
+  "Berga", "Dénia", "Reus", "Granollers", "Mataró", "Figueres", "Olot",
+  "Badalona", "Tàrrega", "Amposta", "El Bruc", "Valls",
+  "Vilafranca del Penedés", "Manacor", "Alcúdia", "Sóller", "Artà",
   "Llucmajor", "Felanitx", "Andratx", "Ciutadella", "Penyiscola",
-  "Sitges", "Vilanova i la Geltrú", "Viella", "L'Alguer", "Perelló",
-  "Torelló", "Sant Cugat", "Portbou (ocean)", "Palafrugell", "Manlleu",
-  "Sallent", "Puigcerdà", "Bellver", "Sant Boi de Llobregat",
-  "Vandellós", "Cornellà", "Tremp", "Palamós", "El Vendrell",
-  "Sant Feliu de Guíxols", "Sant Celoni", "Martorell", "L'Hospitalet",
-  "Mollet del Vallès", "Banyoles", "Blanes", "Lloret de mar (ocean)",
+  "Sitges", "Vilanova i la Geltrú", "Viella", "L'Alguer", "Perelló",
+  "Torelló", "Sant Cugat", "Portbou (ocean)", "Palafrugell", "Manlleu",
+  "Sallent", "Puigcerdà", "Bellver", "Sant Boi de Llobregat",
+  "Vandellós", "Cornellà", "Tremp", "Palamós", "El Vendrell",
+  "Sant Feliu de Guíxols", "Sant Celoni", "Martorell", "L'Hospitalet",
+  "Mollet del Vallès", "Banyoles", "Blanes", "Lloret de mar (ocean)",
   "Malgrat de mar (ocean)", "Canet de mar (ocean)", "Molins de Rei",
-  "Pons", "Súria", "Llívia", "La Bisbal d'Empurdà", "Prada", "Elna",
-  "Ceret", "Cadaqués", "Begur", "Olesa de Montserrat (hills)"
+  "Pons", "Súria", "Llívia", "La Bisbal d'Empurdà", "Prada", "Elna",
+  "Ceret", "Cadaqués", "Begur", "Olesa de Montserrat (hills)"
Index: data/nation/chilean.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/chilean.ruleset,v
retrieving revision 1.13
diff -u -r1.13 chilean.ruleset
--- data/nation/chilean.ruleset 24 Jul 2004 12:26:06 -0000      1.13
+++ data/nation/chilean.ruleset 25 Aug 2004 16:20:51 -0000
@@ -4,7 +4,7 @@
 plural=_("?plural:Chileans")
 class=_("Modern")
 legend=_("Chile is located on the south-western coast of South America.")
-leader="Pedro de Valdivia", "Bernardo O'Higgins", "José Miguel Carrera",
+leader="Pedro de Valdivia", "Bernardo O'Higgins", "José Miguel Carrera",
        "Manuel Blanco Encalada", "Diego Portales", "Manuel Montt",
        "Arturo Alessandri", "Augusto Pinochet"
 leader_sex="Male", "Male", "Male",
@@ -31,22 +31,22 @@
 civilwar_nations = "argentine"
 
 cities =
-  "Santiago", "La Serena", "Concepción", "Valparaíso (hills)",
-  "Rancagua", "Talca", "Punta Arenas (ocean)", "Copiapó",
+  "Santiago", "La Serena", "Concepción", "Valparaíso (hills)",
+  "Rancagua", "Talca", "Punta Arenas (ocean)", "Copiapó",
   "Puerto Montt (ocean)", "Antofagasta", "Iquique", "Coyhaique",
-  "Temuco (forest, river)", "Viña del mar (ocean)", "Coquimbo",
-  "San Antonio", "La Calera (hills)", "Chillán", "Talcahuano", "Osorno",
+  "Temuco (forest, river)", "Viña del mar (ocean)", "Coquimbo",
+  "San Antonio", "La Calera (hills)", "Chillán", "Talcahuano", "Osorno",
   "Valdivia", "Puerto Varas (ocean)", "Llanquihue", "Ancud", "Castro",
-  "Calama", "Arica", "Constitución", "Chañaral", "Cauquenes",
+  "Calama", "Arica", "Constitución", "Chañaral", "Cauquenes",
   "Puente Alto (river, hills)", "Talagante", "Melipilla", "Peumo",
   "Puerto Natales (ocean)", "Lota", "Ovalle", "Huasco", "Mejillones",
   "Victoria", "San Felipe", "Frutillar", "Illapel", "Angol",
-  "San Fernando", "Toltén", "Curicó", "Pisagua", "Tocopilla",
-  "Vallenar", "Caldera", "Lebu", "La Ligua", "Villarrica", "Pucón",
-  "Puerto Aisén (ocean)", "Tomé", "Mulchén", "Taltal", "Putre",
-  "Vicuña", "Combarbalá", "Los Andes (hills)", "Quillota", "Molina",
+  "San Fernando", "Toltén", "Curicó", "Pisagua", "Tocopilla",
+  "Vallenar", "Caldera", "Lebu", "La Ligua", "Villarrica", "Pucón",
+  "Puerto Aisén (ocean)", "Tomé", "Mulchén", "Taltal", "Putre",
+  "Vicuña", "Combarbalá", "Los Andes (hills)", "Quillota", "Molina",
   "Chanco", "Parral", "Bulnes", "Yungay", "Coronel", "Yumbel",
-  "Traiguén (river)", "Pitrufquén", "Calbuco (ocean)",
-  "Maullín (swamp)", "Pelequén", "Algarrobo", "Puerto Toro (ocean)",
+  "Traiguén (river)", "Pitrufquén", "Calbuco (ocean)",
+  "Maullín (swamp)", "Pelequén", "Algarrobo", "Puerto Toro (ocean)",
   "Cachiyuyo", "Pelotillehue"
 
Index: data/nation/danish.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/danish.ruleset,v
retrieving revision 1.12
diff -u -r1.12 danish.ruleset
--- data/nation/danish.ruleset  24 Jul 2004 12:26:06 -0000      1.12
+++ data/nation/danish.ruleset  25 Aug 2004 16:20:51 -0000
@@ -10,7 +10,7 @@
 reign of Harald Blatand, who unified what is now Denmark between 958AD and \
 988AD.")
 leader=
-  "Gudfred", "Gorm den Gamle", "Harald Blåtand", "Svend Tveskæg",
+  "Gudfred", "Gorm den Gamle", "Harald Blåtand", "Svend Tveskæg",
   "Knud den Store", "Hardeknud", "Svend", "Knud", "Valdemar",
   "Valdemar den Store", "Valdemar Sejr", "Erik Klipping",
   "Valdemar Atterdag", "Margrethe I", "Christian IV", "Dag Hammarskjold"
@@ -36,12 +36,12 @@
 civilwar_nations = "english"
 
 cities =
-  "København", "Århus", "Odense", "Ålborg", "Esbjerg", "Randers",
-  "Frederikshavn", "Helsingør", "Roskilde", "Slagelse", "Sønderborg",
-  "Åbenrå", "Haderslev", "Vejle", "Holstebro", "Hirtshals", "Tylstrup",
-  "Skagen", "Hjørring", "Blokhus", "Nørresundby", "Hanstholm", "Thisted",
-  "Løgstør", "Thyborøn", "Skive", "Hadsund", "Ålestrup", "Grenå",
-  "Struer", "Herning", "Silkeborg", "Yding", "Skovhøj", "Give", "Tarm",
-  "Varde", "Assens", "Nyborg", "Fåborg", "Korsør", "Næstved", "Vordingborg",
-  "Nakskov", "Rødby", "Birkerød", "Nykøbing", "Rønne", "Allinge", "Neksø",
-  "Fredericia", "Godthåb", "Julianehåb", "Daneborg"
+  "København", "�rhus", "Odense", "�lborg", "Esbjerg", "Randers",
+  "Frederikshavn", "Helsingør", "Roskilde", "Slagelse", "Sønderborg",
+  "�benrå", "Haderslev", "Vejle", "Holstebro", "Hirtshals", "Tylstrup",
+  "Skagen", "Hjørring", "Blokhus", "Nørresundby", "Hanstholm", "Thisted",
+  "Løgstør", "Thyborøn", "Skive", "Hadsund", "�lestrup", "Grenå",
+  "Struer", "Herning", "Silkeborg", "Yding", "Skovhøj", "Give", "Tarm",
+  "Varde", "Assens", "Nyborg", "Fåborg", "Korsør", "Næstved", "Vordingborg",
+  "Nakskov", "Rødby", "Birkerød", "Nykøbing", "Rønne", "Allinge", "Neksø",
+  "Fredericia", "Godthåb", "Julianehåb", "Daneborg"
Index: data/nation/dunedain.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/dunedain.ruleset,v
retrieving revision 1.10
diff -u -r1.10 dunedain.ruleset
--- data/nation/dunedain.ruleset        24 Jul 2004 12:26:06 -0000      1.10
+++ data/nation/dunedain.ruleset        25 Aug 2004 16:20:51 -0000
@@ -8,7 +8,7 @@
 plural=_("?plural:Dunedan")
 class=_("Fictional")
 legend=_("The Men of the West from J.R.R. Tolkien's Middle Earth fantasies.")
-leader="Elros", "Tar-Ancalimë", "Míriel", "Elendil", "Isildur", "Aragorn",
+leader="Elros", "Tar-Ancalimë", "Míriel", "Elendil", "Isildur", "Aragorn",
        "Tarannon Falastur", "Thorongil", "Ar-Pharazon", "Beruthiel"
 leader_sex="Male", "Female", "Female", "Male", "Male", "Male",
        "Male", "Male", "Male", "Female"
@@ -28,15 +28,15 @@
 civilwar_nations = "mordor"
 
 cities =
-  "Armenelos", "Romenna", "Meneltarma (mountains)", "Andúnië",
-  "Eldalondë (ocean)", "Nindamos", "Vinyalondë (ocean)", "Lond Daer (ocean)",
-  "Emerië", "Hyarastorni", "Osgiliath", "Minas Anor", "Minas Ithil",
-  "Pelargir", "Erech (hills)", "Umbar", "Aglarond", "Annúminas",
-  "Amon Sûl (hills)", "Fornost", "Ethring (river)", "Dol Amroth",
+  "Armenelos", "Romenna", "Meneltarma (mountains)", "Andúnië",
+  "Eldalondë (ocean)", "Nindamos", "Vinyalondë (ocean)", "Lond Daer (ocean)",
+  "Emerië", "Hyarastorni", "Osgiliath", "Minas Anor", "Minas Ithil",
+  "Pelargir", "Erech (hills)", "Umbar", "Aglarond", "Annúminas",
+  "Amon Sûl (hills)", "Fornost", "Ethring (river)", "Dol Amroth",
   "Edhellond (ocean)", "Linhir", "Calembel", "Tharbad", "Elostirion (hills)",
-  "Isengard (hills)", "Belfalas", "Anórien", "Bree (hills)", "Staddle",
+  "Isengard (hills)", "Belfalas", "Anórien", "Bree (hills)", "Staddle",
   "Combe", "Archet", "Minas Tirith", "Halifirien (mountains, hills)",
   "Calenhad", "Min-Rimmon (hills)", "Erelas", "Nardol", "Eilenach (hills)",
-  "Amon Dîn (hills)", "Henneth Annûn", "Tarnost", "Arthedain", "Cardolan",
+  "Amon Dîn (hills)", "Henneth Annûn", "Tarnost", "Arthedain", "Cardolan",
   "Calenardhon", "Enedwaith", "Evendim", "Lamedon", "Lebennin",
   "Lossarnach (!mountains)", "Minhiriath"
Index: data/nation/estonian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/estonian.ruleset,v
retrieving revision 1.8
diff -u -r1.8 estonian.ruleset
--- data/nation/estonian.ruleset        24 Jul 2004 12:26:06 -0000      1.8
+++ data/nation/estonian.ruleset        25 Aug 2004 16:20:51 -0000
@@ -6,7 +6,7 @@
 legend=_("Estonia is a small country on the south shore of the eastern \
 Baltic Sea.  Its people and language are closely related to those of \
 Finland.")
-leader="Kalevipoeg", "Lembitu", "Carl Robert Jakobson", "Konstantin Päts",
+leader="Kalevipoeg", "Lembitu", "Carl Robert Jakobson", "Konstantin Päts",
   "Tunne Kelam", "Lennart Meri", "Mart Laar"
 leader_sex="Male", "Male", "Male", "Male",
   "Male", "Male", "Male"
@@ -22,10 +22,10 @@
 civilwar_nations = "danish", "dutch"
 
 cities =
-  "Tallinn", "Tartu", "Narva", "Kohtla-Järve", "Pärnu",
-  "Viljandi", "Rakvere", "Valga", "Võru", "Sillamäe",
-  "Kuressaare", "Haapsalu", "Kiviõli", "Tapa", "Paide",
-  "Maardu", "Paldiski", "Türi", "Keila", "Elva",
-  "Kunda", "Põltsamaa", "Sindi", "Kärdla", "Tõrva",
-  "Otepää", "Kilingi-Nõmme", "Mustvee", "Antsla", "Mõisaküla",
+  "Tallinn", "Tartu", "Narva", "Kohtla-Järve", "Pärnu",
+  "Viljandi", "Rakvere", "Valga", "Võru", "Sillamäe",
+  "Kuressaare", "Haapsalu", "Kiviõli", "Tapa", "Paide",
+  "Maardu", "Paldiski", "Türi", "Keila", "Elva",
+  "Kunda", "Põltsamaa", "Sindi", "Kärdla", "Tõrva",
+  "Otepää", "Kilingi-Nõmme", "Mustvee", "Antsla", "Mõisaküla",
   "Suure-Jaani", "Kallaste", "Mustla"
Index: data/nation/finnish.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/finnish.ruleset,v
retrieving revision 1.9
diff -u -r1.9 finnish.ruleset
--- data/nation/finnish.ruleset 24 Jul 2004 12:26:06 -0000      1.9
+++ data/nation/finnish.ruleset 25 Aug 2004 16:20:51 -0000
@@ -43,31 +43,31 @@
 cities =
  "Helsinki (ocean)", "Turku (ocean, river)", "Oulu (ocean, river)",
  "Tampere", "Pori (ocean, river)", "Porvoo (ocean, river)", "Vaasa (ocean)",
- "Rauma (ocean)", "Lappeenranta", "Kuopio", "Hämeenlinna", "Kokkola (ocean)",
- "Kajaani", "Jyväskylä", "Savonlinna", "Lahti (hills)", "Tornio (river)",
+ "Rauma (ocean)", "Lappeenranta", "Kuopio", "Hämeenlinna", "Kokkola (ocean)",
+ "Kajaani", "Jyväskylä", "Savonlinna", "Lahti (hills)", "Tornio (river)",
  "Joensuu (river)", "Naantali (ocean)", "Pietarsaari (ocean)",
  "Kotka (ocean, river)", "Uusikaupunki (ocean)", "Tammisaari (ocean)",
  "Raahe (ocean)", "Espoo", "Mikkeli", "Vantaa (river)", "Heinola",
  "Hamina (ocean)", "Kemi (ocean, river)", "Kristiinankaupunki (ocean)",
- "Uusikaarlepyy (river)", "Iisalmi", "Loviisa (ocean)", "Hyvinkää (!ocean)",
+ "Uusikaarlepyy (river)", "Iisalmi", "Loviisa (ocean)", "Hyvinkää (!ocean)",
  "Maarianhamina (ocean)", "Rovaniemi (!ocean, river)", "Hanko (ocean)",
- "Kouvola (!ocean)", "Seinäjoki (!ocean, river)", "Järvenpää", "Lohja (hills)",
- "Riihimäki (!ocean)", "Salo", "Imatra (river)", "Varkaus", "Kerava (!ocean)",
+ "Kouvola (!ocean)", "Seinäjoki (!ocean, river)", "Järvenpää", "Lohja 
(hills)",
+ "Riihimäki (!ocean)", "Salo", "Imatra (river)", "Varkaus", "Kerava (!ocean)",
  "Valkeakoski", "Forssa (!ocean)", "Nokia", "Raisio (ocean)", "Kuusankoski",
- "Vammala", "Pieksämäki", "Lieksa", "Anjalankoski (river, !ocean)",
- "Ylivieska (river, !ocean)", "Äänekoski", "Kankaanpää (!ocean)",
- "Kaskinen (ocean)", "Lapua (river, !ocean)", "Jämsä", "Kemijärvi (river)",
+ "Vammala", "Pieksämäki", "Lieksa", "Anjalankoski (river, !ocean)",
+ "Ylivieska (river, !ocean)", "�änekoski", "Kankaanpää (!ocean)",
+ "Kaskinen (ocean)", "Lapua (river, !ocean)", "Jämsä", "Kemijärvi (river)",
  "Parainen (ocean)", "Nurmes", "Kurikka (!ocean)", "Kauniainen",
  "Alavus (!ocean)", "Loimaa (river, !ocean)", "Huittinen (river, !ocean)",
- "Kokemäki (river, !ocean)", "Karjaa", "Karkkila (!ocean)",
+ "Kokemäki (river, !ocean)", "Karjaa", "Karkkila (!ocean)",
  "Virrat (river, !ocean)", "Outokumpu (!ocean, hills)",
- "Haapajärvi (river, !ocean)", "Mänttä", "Suonenjoki (river, !ocean)",
+ "Haapajärvi (river, !ocean)", "Mänttä", "Suonenjoki (river, !ocean)",
  "Oulainen (!ocean)", "Toijala (!ocean)", "Harjavalta (river, !ocean)",
  "Parkano (river, !ocean)", "Ikaalinen", "Keuruu", "Kuhmo (!ocean)",
- "Saarijärvi", "Kaarina (river)", "Suolahti", "Alajärvi", "Orivesi",
+ "Saarijärvi", "Kaarina (river)", "Suolahti", "Alajärvi", "Orivesi",
  "Laitila (!ocean)", "Kauhava (!ocean)", "Orimattila (!ocean)",
- "Jämsänkoski (river)", "Ähtäri (!ocean)", "Nivala (river, !ocean)",
+ "Jämsänkoski (river)", "�htäri (!ocean)", "Nivala (river, !ocean)",
  "Kannus (river, !ocean)", "Kitee", "Kiuruvesi (river, !ocean)",
- "Närpiö (ocean)", "Somero (river, !ocean)", "Pyhäjärvi",
- "Haapavesi (river, !ocean)", "Viitasaari", "Paimio", "Nilsiä",
+ "Närpiö (ocean)", "Somero (river, !ocean)", "Pyhäjärvi",
+ "Haapavesi (river, !ocean)", "Viitasaari", "Paimio", "Nilsiä",
  "Juankoski (river, !ocean)"
Index: data/nation/french.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/french.ruleset,v
retrieving revision 1.10
diff -u -r1.10 french.ruleset
--- data/nation/french.ruleset  24 Jul 2004 12:26:06 -0000      1.10
+++ data/nation/french.ruleset  25 Aug 2004 16:20:51 -0000
@@ -26,10 +26,10 @@
 cities =
   "Paris", "Lyon", "Marseille", "Lille", "Bordeaux",
   "Nantes", "Rouen", "Reims", "Tours", "Angers",
-  "Toulouse", "Montpellier", "Nîmes", "Toulon", "Orléans",
+  "Toulouse", "Montpellier", "Nîmes", "Toulon", "Orléans",
   "Chartres", "Avignon", "Grenoble", "Dijon", "Amiens",
   "Cherbourg", "Caen", "Calais", "Limoges", "Clermont-Ferrand",
-  "Nancy", "Besançon", "St. Etienne", "Brest", "Perpignan",
+  "Nancy", "Besançon", "St. Etienne", "Brest", "Perpignan",
   "Vichy", "Rennes", "Le Havre", "La Rochelle", "Poitiers",
   "St. Nazaire", "Bourges", "Le Mans", "Valenciennes", "Montlucon"
 
Index: data/nation/german.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/german.ruleset,v
retrieving revision 1.16
diff -u -r1.16 german.ruleset
--- data/nation/german.ruleset  24 Jul 2004 12:26:06 -0000      1.16
+++ data/nation/german.ruleset  25 Aug 2004 16:20:51 -0000
@@ -9,7 +9,7 @@
 Nazism 1933 and started World War II.  After the war it was split \
 into two states, which reunited in 1990 at the end of the Cold War.")
 
-leader = "Arminius", "Alarich", "Karl der Große", "Otto I.", 
+leader = "Arminius", "Alarich", "Karl der GroÃ?e", "Otto I.", 
          "Friedrich I. Barbarossa", "Friedrich II.", "Wilhelm I.",
          "Otto von Bismarck", "Friedrich Ebert", "Adolf Hitler", 
          "Konrad Adenauer", "Willy Brandt", "Erich Honecker"
@@ -38,17 +38,17 @@
 cities =
   "Berlin (grassland, !mountains)", 
   "Hamburg(grassland, swamp, ocean, river, !mountains)",
-  "München (hills, mountains, !ocean)", 
-  "Köln (plains, hills, river)", 
+  "München (hills, mountains, !ocean)", 
+  "Köln (plains, hills, river)", 
   "Frankfurt am Main (grassland, hills, river, !ocean)",
   "Essen (grassland, hills, !river)", 
   "Dortmund (grassland, hills)",
   "Stuttgart (hills, !ocean)", 
-  "Düsseldorf (grassland, hills, river)", 
+  "Düsseldorf (grassland, hills, river)", 
   "Bremen (grassland, plains, swamp, ocean, river, !mountains)",
   "Duisburg (grassland, hills, river)",
   "Hannover (grassland, plains, !mountains)",
-  "Nürnberg (hills, mountains, river, !ocean)", 
+  "Nürnberg (hills, mountains, river, !ocean)", 
   "Leipzig (grassland, plains, hills, !ocean)",
   "Dresden (plains, hills, river, !ocean)",
   "Bochum (grassland, plains, hills, !river)",
@@ -62,8 +62,8 @@
   "Karlsruhe (plains, forest, river, !ocean)",
   "Wiesbaden (plains, hills, river, !ocean)",
   "Magdeburg (grassland, plains, river)",
-  "Münster (grassland, plains, !river)",
-  "Mönchengladbach (grassland, plains, !river)", 
+  "Münster (grassland, plains, !river)",
+  "Mönchengladbach (grassland, plains, !river)", 
   "Augsburg (forest, hills, mountains, river, !ocean)",
   "Braunschweig (grassland, plains)",
   "Krefeld (grassland, plains, !river)",
@@ -71,18 +71,18 @@
   "Aachen (plains, hills)",
   "Rostock (grassland, ocean, river, !mountains)",
   "Oberhausen (grassland, plains, river)",
-  "Lübeck (grassland, ocean, river, !mountains)",
+  "Lübeck (grassland, ocean, river, !mountains)",
   "Hagen (plains, hills)",
   "Kassel (plains, forest, !ocean)",
   "Erfurt (hills, forest, !ocean)",
   "Freiburg i. Br. (plains, forest, hills, mountains, !ocean)",
-  "Saarbrücken (forest, hills, river, !ocean)",
+  "Saarbrücken (forest, hills, river, !ocean)",
   "Mainz (plains, hills, river, !ocean)",
   "Hamm (grassland, hills)",
   "Herne (plains, hills)",
-  "Mülheim an der Ruhr (grassland, hills, river)",
+  "Mülheim an der Ruhr (grassland, hills, river)",
   "Ludwigshafen (grassland, forest, river, !ocean)",
-  "Osnabrück (grassland, plains, forest)",
+  "Osnabrück (grassland, plains, forest)",
   "Solingen (plains, hills, !river)",
   "Leverkusen (plains, hills, river)",
   "Neuss (plains, hills, river)",
@@ -92,8 +92,8 @@
   "Potsdam (grassland, swamp, !mountains)",
   "Bremerhaven (grassland, swamp, ocean, river, !mountains)",
   "Paderborn (plains, forest)",
-  "Würzburg (plains, forest, river, !ocean)",
-  "Göttingen (forest, hills, !ocean)",
+  "Würzburg (plains, forest, river, !ocean)",
+  "Göttingen (forest, hills, !ocean)",
   "Cottbus (swamp, plains, forest, river)",
   "Wolfsburg (grassland, plains)",
   "Recklinghausen (grassland, plains, hills, !river)",
@@ -110,7 +110,7 @@
   "Siegen (forest, hills, river)",
   "Koblenz (forest, hills, river, !ocean)", 
   "Ingolstadt (hills, river, !ocean)",
-  "Fürth (hills, !ocean)",
+  "Fürth (hills, !ocean)",
   "Zwickau (forest, hills, !ocean)",
   "Reutlingen (forest, hills, !ocean)",
   "Moers (plains, hills)",
@@ -131,14 +131,14 @@
   "Passau (hills, mountains, river, !ocean)",
   "Verden (grassland, plains, swamp, ocean)",
   "Wismar (grassland, ocean, !mountains)",
-  "Nördlingen (forest, hills, !river, !ocean)",
+  "Nördlingen (forest, hills, !river, !ocean)",
   "Stralsund (grassland, ocean, !mountains)",
   "Mansfeld (plains, hills, !ocean)",
-  "Donauwörth (hills, mountains, river)",
+  "Donauwörth (hills, mountains, river)",
   "Dessau (plains, forest)",
   "Worms (plains, forest, river, !ocean)",
   "Wittstock (grassland, plains, ocean, !mountains)",
-  "Mühlberg (plains, river, !ocean)",
+  "Mühlberg (plains, river, !ocean)",
   "Speyer (plains, hills, river, !ocean)",
   "Kleve (grassland, plains, river)",
   "Landau (forest, hills, !ocean)",
Index: data/nation/hungarian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/hungarian.ruleset,v
retrieving revision 1.8
diff -u -r1.8 hungarian.ruleset
--- data/nation/hungarian.ruleset       24 Jul 2004 12:26:06 -0000      1.8
+++ data/nation/hungarian.ruleset       25 Aug 2004 16:20:51 -0000
@@ -3,8 +3,8 @@
 name=_("Hungarian")
 plural=_("?plural:Hungarians")
 class=_("Modern")
-leader="Árpád", "Szent István", "Károly Róbert",
-       "Hunyadi Mátyás", "Mária Terézia", "Batthyány"
+leader="�rpád", "Szent István", "Károly Róbert",
+       "Hunyadi Mátyás", "Mária Terézia", "Batthyány"
 leader_sex="Male", "Male", "Male", "Male", "Female", "Male"
 flag="f.hungary"
 flag_alt = "-"
@@ -20,18 +20,18 @@
 civilwar_nations = "lithuanian", "croatian", "slovenian"
 
 cities =
- "Budapest", "Debrecen", "Székesfehérvár", "Kolozsvár", "Szeged",
- "Kassa", "Pécs", "Pozsony", "Miskolc", "Nagyvárad", "Gyõr",
- "Esztergom", "Temesvár", "Komárom", "Nyíregyháza", "Marosvásárhely",
- "Sopron", "Szabadka", "Kecskemét", "Veszprém", "Besztercebánya",
- "Békéscsaba", "Munkács", "Eger", "Eperjes", "Gyulafehérvár", "Kaposvár",
+ "Budapest", "Debrecen", "Székesfehérvár", "Kolozsvár", "Szeged",
+ "Kassa", "Pécs", "Pozsony", "Miskolc", "Nagyvárad", "Gyõr",
+ "Esztergom", "Temesvár", "Komárom", "Nyíregyháza", "Marosvásárhely",
+ "Sopron", "Szabadka", "Kecskemét", "Veszprém", "Besztercebánya",
+ "Békéscsaba", "Munkács", "Eger", "Eperjes", "Gyulafehérvár", "Kaposvár",
  "Szolnok", "Paks", "Zalaegerszeg", "Arad", "Szombathely",
- "Mohács", "Hatvan", "Selmecbánya", "Keszthely", "Ungvár", "Szekszárd",
- "Sárospatak", "Tatabánya", "Baja", "Szigetvár", "Csíkszereda",
- "Nagykanizsa", "Hódmezõvásárhely", "Siklós", "Érsekújvár", "Pápa",
- "Gyöngyös",  "Dunaújváros", "Szatmárnémeti", "Szentes",
- "Mosonmagyaróvár",  "Léva", "Szarvas", "Csáktornya",
- "Mátészalka", "Tata", "Nagykõrös", "Nagyszeben",
- "Salgótarján", "Újvidék", "Siófok", "Losonc", "Gyula",
- "Sátoraljaújhely", "Déva", "Tapolca", "Tiszaújváros", "Dombóvár",
- "Püspökladány", "Balatonfüred", "Vác"
+ "Mohács", "Hatvan", "Selmecbánya", "Keszthely", "Ungvár", "Szekszárd",
+ "Sárospatak", "Tatabánya", "Baja", "Szigetvár", "Csíkszereda",
+ "Nagykanizsa", "Hódmezõvásárhely", "Siklós", "�rsekújvár", "Pápa",
+ "Gyöngyös",  "Dunaújváros", "Szatmárnémeti", "Szentes",
+ "Mosonmagyaróvár",  "Léva", "Szarvas", "Csáktornya",
+ "Mátészalka", "Tata", "Nagykõrös", "Nagyszeben",
+ "Salgótarján", "�jvidék", "Siófok", "Losonc", "Gyula",
+ "Sátoraljaújhely", "Déva", "Tapolca", "Tiszaújváros", "Dombóvár",
+ "Püspökladány", "Balatonfüred", "Vác"
Index: data/nation/mordor.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/mordor.ruleset,v
retrieving revision 1.8
diff -u -r1.8 mordor.ruleset
--- data/nation/mordor.ruleset  24 Jul 2004 12:26:06 -0000      1.8
+++ data/nation/mordor.ruleset  25 Aug 2004 16:20:51 -0000
@@ -24,11 +24,11 @@
 civilwar_nations = "dunedain"
 
 cities =
-  "Barad-Dûr", "Durthang", "Orodruin", "Morannon", "Dol Guldur",
+  "Barad-Dûr", "Durthang", "Orodruin", "Morannon", "Dol Guldur",
   "Minas Morgul", "Cirith Ungol", "Moria", "Angmar", "Gorgoroth",
-  "Morgai", "Nurn", "Khand", "Rhûn", "Harad", "Dagorlad", "Ephel Dúath",
-  "Ered Lithui", "Emyn Muil", "Núrnen", "Poros", "Harnen", "Lugbúrz",
-  "Angband", "Carn Dûm", "Utumno", "Amon Amarth",  "Thangorodrim", 
+  "Morgai", "Nurn", "Khand", "Rhûn", "Harad", "Dagorlad", "Ephel Dúath",
+  "Ered Lithui", "Emyn Muil", "Núrnen", "Poros", "Harnen", "Lugbúrz",
+  "Angband", "Carn Dûm", "Utumno", "Amon Amarth",  "Thangorodrim", 
   "Orthanc", "Angrenost", "Mount Fang", "Cirith Gorgor", "Moontower", 
-  "Hells of Iron", "Udûn", "Havens of Umbar", "Phurunargian", "Khand", 
-  "Rhûn", "Sammath Naur"
+  "Hells of Iron", "Udûn", "Havens of Umbar", "Phurunargian", "Khand", 
+  "Rhûn", "Sammath Naur"
Index: data/nation/polish.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/polish.ruleset,v
retrieving revision 1.14
diff -u -r1.14 polish.ruleset
--- data/nation/polish.ruleset  24 Jul 2004 12:26:06 -0000      1.14
+++ data/nation/polish.ruleset  25 Aug 2004 16:20:51 -0000
@@ -30,12 +30,12 @@
 civilwar_nations = "lithuanian", "silesian"
 
 cities =
- "Gniezno", "Kraków", "Warszawa (river)", "Wroclaw", "Poznan", 
- "Gdansk (ocean)", "Szczecin", "Lódz", "Torun", "Bydgoszcz", "Lublin", 
+ "Gniezno", "Kraków", "Warszawa (river)", "Wroclaw", "Poznan", 
+ "Gdansk (ocean)", "Szczecin", "Lódz", "Torun", "Bydgoszcz", "Lublin", 
  "Czestochowa", "Olsztyn", "Wloclawek", "Radom", "Kolobrzeg (ocean)", 
- "Kielce", "Bialystok", "Plock", "Rzeszów", "Tarnów", "Katowice", 
+ "Kielce", "Bialystok", "Plock", "Rzeszów", "Tarnów", "Katowice", 
  "Bielsko-Biala", "Sandomierz", "Legnica", "Walbrzych", "Gdynia", 
- "Koszalin", "Slupsk", "Piotrków", "Konin", "Kalisz", "Krosno", 
+ "Koszalin", "Slupsk", "Piotrków", "Konin", "Kalisz", "Krosno", 
  "Przemysl", "Tarnobrzeg", "Zamosc", "Chelm", "Suwalki", "Elblag", 
  "Zakopane (mountains)", "Oswiecim", "Glogow", "Jawor", 
  "Zielona Gora (hills, forest)",  "Jelenia Gora (hills)",
Index: data/nation/portuguese.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/portuguese.ruleset,v
retrieving revision 1.9
diff -u -r1.9 portuguese.ruleset
--- data/nation/portuguese.ruleset      24 Jul 2004 12:26:06 -0000      1.9
+++ data/nation/portuguese.ruleset      25 Aug 2004 16:20:51 -0000
@@ -7,7 +7,7 @@
 in the 1400s on the shipbuilding advances funded by Prince Henry the \
 Navigator.")
 leader="Afonso Henriques", "Sancho I", "Dinis", "Afonso IV",
-       "João I", "João II", "Manuel I", "João IV", "Maria II", "Salazar"
+       "João I", "João II", "Manuel I", "João IV", "Maria II", "Salazar"
 leader_sex="Male", "Male", "Male", "Male",
           "Male", "Male", "Male", "Male", "Female", "Male"
 flag="f.portugal"
@@ -27,16 +27,16 @@
 civilwar_nations = "brazilian"
 
 cities =
- "Lisboa", "Guimarães", "Guarda", "Vila Real", "Viseu", "Braga",
- "Porto (ocean)", "Coimbra", "Aveiro", "Leiria", "Bragança",
- "Barcelos", "Sintra", "Setúbal", "Alcácer do Sal", "Santarém",
- "Silves", "Évora", "Portalegre (ocean)", "Faro", "Elvas", "Óbidos",
- "Alcobaça", "Alcochete", "Alcoutim", "Tomar", "Alenquer",
- "Aljubarrota", "Fátima", "Batalha", "Nazaré", "Aljustrel", "Almada",
+ "Lisboa", "Guimarães", "Guarda", "Vila Real", "Viseu", "Braga",
+ "Porto (ocean)", "Coimbra", "Aveiro", "Leiria", "Bragança",
+ "Barcelos", "Sintra", "Setúbal", "Alcácer do Sal", "Santarém",
+ "Silves", "Ã?vora", "Portalegre (ocean)", "Faro", "Elvas", "Ã?bidos",
+ "Alcobaça", "Alcochete", "Alcoutim", "Tomar", "Alenquer",
+ "Aljubarrota", "Fátima", "Batalha", "Nazaré", "Aljustrel", "Almada",
  "Almeirim", "Aljezur", "Odemira", "Viana do Castelo (mountains)",
  "Chaves", "Castelo Branco (mountains)", "Caldas da Rainha",
- "Estremoz", "Vila Viçosa", "Sines", "Portimão", "Albufeira", "Lagos",
- "Tavira", "Marvão", "Mafra", "Palmela", "Cascais", "Estoril",
+ "Estremoz", "Vila Viçosa", "Sines", "Portimão", "Albufeira", "Lagos",
+ "Tavira", "Marvão", "Mafra", "Palmela", "Cascais", "Estoril",
  "Funchal", "Ponta Delgada", "Torres Vedras", "Torres Novas",
  "Amadora", "Queluz", "Maia", "Figueira da Foz (river)", "Matosinhos",
  "Vila Nova de Gaia"
Index: data/nation/silesian.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/silesian.ruleset,v
retrieving revision 1.9
diff -u -r1.9 silesian.ruleset
--- data/nation/silesian.ruleset        24 Jul 2004 12:26:06 -0000      1.9
+++ data/nation/silesian.ruleset        25 Aug 2004 16:20:51 -0000
@@ -20,7 +20,7 @@
 init_buildings=""
 
 tech_goals="The Republic", "Trade", "Feudalism", "Railroad", "Steel"
-wonder="Great Wall" ; Yes, we had own great wall ( iso-8859-2 ("Wa³y ¦l±skie") 
)
+wonder="Great Wall" ; Yes, we had own great wall ( iso-8859-2 ("Wa³y 
¦l±skie") )
 government="Democracy"
 civilwar_nations = "polish"
 
@@ -28,11 +28,11 @@
 ; only leave first 3 cities where they are
 
 cities =
-  "Wroclaw", "Opole", "Katowice", "Legnica", "Zielona Góra (hills, grassland)",
-  "Glogów (forest)", "Boleslawiec", "Walbrzych", "Gliwice", "Rybnik (river)", 
-  "Jelenia Gora (mountains)", "Swidnica", "Lubin", "Chojnów", "Malczyce", 
+  "Wroclaw", "Opole", "Katowice", "Legnica", "Zielona Góra (hills, 
grassland)",
+  "Glogów (forest)", "Boleslawiec", "Walbrzych", "Gliwice", "Rybnik (river)", 
+  "Jelenia Gora (mountains)", "Swidnica", "Lubin", "Chojnów", "Malczyce", 
   "Klodzko", "Bytom", "Oswiecim", "Zlotoryja", "Bielany", "Zgorzelec", 
   "Zary", "Bystrzyca (river)", "Zagan", "Bogatynia", 
-  "Chocianów", "Nowa Sól", "Zabrze", "Sosnowiec (forest)",
+  "Chocianów", "Nowa Sól", "Zabrze", "Sosnowiec (forest)",
   "Rokitki", "Luban", "Polkowice", "Lubiaz", "Kedzierzyn-Kozle",
-  "Chorzów", "Bielsko", "Cieszyn"
+  "Chorzów", "Bielsko", "Cieszyn"
Index: data/nation/spanish.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/spanish.ruleset,v
retrieving revision 1.9
diff -u -r1.9 spanish.ruleset
--- data/nation/spanish.ruleset 24 Jul 2004 12:26:06 -0000      1.9
+++ data/nation/spanish.ruleset 25 Aug 2004 16:20:51 -0000
@@ -32,38 +32,38 @@
 cities =
   "Madrid", "Barcelona", "Bilbao", "Valencia", "Sevilla", "Zaragoza",
   "Pamplona", "Oviedo", "Valladolid", "Toledo", "Santander", "Granada",
-  "León", "Córdoba", "San Sebastián", "Segovia", "Gerona", "La Coruña",
-  "Murcia", "Málaga", "Cádiz", "Tarragona", "Vitoria", "Burgos",
-  "Palma", "Castellón de la Plana", "Palencia", "Huelva", "Zamora",
-  "Badajoz", "Jaén", "Teruel", "Lugo", "Ciudad Real", "Alicante",
-  "Almería", "Soria", "Logroño", "Pontevedra", "Orense",
+  "León", "Córdoba", "San Sebastián", "Segovia", "Gerona", "La Coruña",
+  "Murcia", "Málaga", "Cádiz", "Tarragona", "Vitoria", "Burgos",
+  "Palma", "Castellón de la Plana", "Palencia", "Huelva", "Zamora",
+  "Badajoz", "Jaén", "Teruel", "Lugo", "Ciudad Real", "Alicante",
+  "Almería", "Soria", "Logroño", "Pontevedra", "Orense",
   "Guadalajara (river)", "Cuenca", "Santa Cruz de Tenerife", "Huesca",
-  "Avila", "Albacete", "Lérida", "Salamanca", "Cáceres",
+  "Avila", "Albacete", "Lérida", "Salamanca", "Cáceres",
   "Las Palmas de Gran Canaria", "Reus", "Linares", "Sabadell",
   "Baracaldo", "Calahorra", "Manacor", "Calatrava", "Getafe", "Alcudia",
-  "Laredo", "Albarracín", "Rentería", "Almazán", "Durango", "Barbastro",
+  "Laredo", "Albarracín", "Rentería", "Almazán", "Durango", "Barbastro",
   "Ciudad Rodrigo", "El Ferrol", "Jerez de la Frontera", "Algeciras",
-  "Estela", "Alcalá de Henares", "Ponferrada", "Calatayud", "Monforte",
-  "Elche", "Orihuela", "Mérida", "Trujillo", "Vigo", "Alcoy", "Tarrasa",
-  "Astorga", "Manresa", "Torrelavega", "Mataró", "Puertollano (hills)",
-  "Plasencia", "Santurce", "Cartagena", "Ibiza", "Mahón", "Badalona",
-  "Gijón", "Aranjuez", "Almadén", "Urgel", "Bailén", "Ampurias",
-  "Navalcarnero", "Güímar", "Carmona", "Betanzos", "La Laguna", "Hijar",
-  "Baltanás", "Villena", "Valdepeñas", "Vergara", "Tolosa", "Sigüenza",
-  "Cangas", "Morella", "Vitigudino", "Marchena", "Armuña", "Tornelloso",
-  "Arzúa", "Belorado", "Jaca", "Castrojeriz (hills)", "Alméniz",
-  "Cervera", "Cifuentes", "Garafía", "Sequeros", "Alarcón", "Segorbe",
-  "Almudévar", "Salvatierra", "Sarnón", "Barbate", "Albañiz", "Gandía",
-  "Lerma", "Villaviciosa", "Játiva", "Calamocha", "Orotava",
-  "Labastida", "Mogán", "Figueras", "Orcera", "Alcaudete", "Alcira",
-  "Zumárraga", "Tudela", "Montalbán", "Reinosa",
-  "Navalmoral de la mata", "Monreal", "Mazarrón", "Lepe",
-  "Montefrío (hills)", "Utrera", "Alcañiz", "Villalba", "Jaraíz",
-  "Vélez", "Almuñécar", "Brunete", "Talavera", "Cardona", "Amposta",
-  "Sacedón", "Marbella", "Vejer de la frontera", "Guadix (river)",
-  "Azpeitía", "Ubeda", "Caspe", "Torquemada", "Lorca", "Benidorm",
-  "Tortosa", "Motril", "Lucena", "Berga", "Monzón", "Agüimes",
+  "Estela", "Alcalá de Henares", "Ponferrada", "Calatayud", "Monforte",
+  "Elche", "Orihuela", "Mérida", "Trujillo", "Vigo", "Alcoy", "Tarrasa",
+  "Astorga", "Manresa", "Torrelavega", "Mataró", "Puertollano (hills)",
+  "Plasencia", "Santurce", "Cartagena", "Ibiza", "Mahón", "Badalona",
+  "Gijón", "Aranjuez", "Almadén", "Urgel", "Bailén", "Ampurias",
+  "Navalcarnero", "Güímar", "Carmona", "Betanzos", "La Laguna", "Hijar",
+  "Baltanás", "Villena", "Valdepeñas", "Vergara", "Tolosa", "Sigüenza",
+  "Cangas", "Morella", "Vitigudino", "Marchena", "Armuña", "Tornelloso",
+  "Arzúa", "Belorado", "Jaca", "Castrojeriz (hills)", "Alméniz",
+  "Cervera", "Cifuentes", "Garafía", "Sequeros", "Alarcón", "Segorbe",
+  "Almudévar", "Salvatierra", "Sarnón", "Barbate", "Albañiz", "Gandía",
+  "Lerma", "Villaviciosa", "Játiva", "Calamocha", "Orotava",
+  "Labastida", "Mogán", "Figueras", "Orcera", "Alcaudete", "Alcira",
+  "Zumárraga", "Tudela", "Montalbán", "Reinosa",
+  "Navalmoral de la mata", "Monreal", "Mazarrón", "Lepe",
+  "Montefrío (hills)", "Utrera", "Alcañiz", "Villalba", "Jaraíz",
+  "Vélez", "Almuñécar", "Brunete", "Talavera", "Cardona", "Amposta",
+  "Sacedón", "Marbella", "Vejer de la frontera", "Guadix (river)",
+  "Azpeitía", "Ubeda", "Caspe", "Torquemada", "Lorca", "Benidorm",
+  "Tortosa", "Motril", "Lucena", "Berga", "Monzón", "Agüimes",
   "Fregenal", "Aguilar", "Antequera", "Tineo", "Sedano", "Lebrija",
-  "Calatañazor", "Azuaga", "Vilches", "Alcántara", "Fraga", "Benavente",
-  "Mondragón", "Calanda", "Daroca", "Valverde", "Belmonte", "Simancas",
+  "Calatañazor", "Azuaga", "Vilches", "Alcántara", "Fraga", "Benavente",
+  "Mondragón", "Calanda", "Daroca", "Valverde", "Belmonte", "Simancas",
   "Coria", "Requena", "Aranda"
Index: data/nation/swedish.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/swedish.ruleset,v
retrieving revision 1.13
diff -u -r1.13 swedish.ruleset
--- data/nation/swedish.ruleset 24 Jul 2004 12:26:06 -0000      1.13
+++ data/nation/swedish.ruleset 25 Aug 2004 16:20:51 -0000
@@ -5,7 +5,7 @@
 class=_("Modern")
 
 leader=
-  "Erik Segergäll", "Olof Skötkonung", "Gustav Vasa", "Erik", "Karl",
+  "Erik Segergäll", "Olof Skötkonung", "Gustav Vasa", "Erik", "Karl",
   "Christine"
 
 leader_sex="Male", "Male", "Male", "Male", "Male", "Female"
@@ -29,72 +29,72 @@
 ;  Kort upplysning om ortnamnens betydelser och ursprung
 ;  =====================================================
 ;
-;  BIRKA betyder Björkö
+;  BIRKA betyder Björkö
 ;
-;  BORG (källa: Våra ord)
-;    fornsvenska islänska <borg>; gemensamt germanskt ord (tyska
-;    <Burg>, engelska <Borough>), besläktat med [berg]
-;
-;  HULT (källa: Våra ord)
-;    skogsdunge, liten skog: fornsvenska <hult>, isländska <holt>;
-;    gemensamt germanskt ord (tyska <Holz> trä, skog) med släktingar i
-;    ett flertal andra indoeuropeiska språk
+;  BORG (källa: Våra ord)
+;    fornsvenska islänska <borg>; gemensamt germanskt ord (tyska
+;    <Burg>, engelska <Borough>), besläktat med [berg]
+;
+;  HULT (källa: Våra ord)
+;    skogsdunge, liten skog: fornsvenska <hult>, isländska <holt>;
+;    gemensamt germanskt ord (tyska <Holz> trä, skog) med släktingar i
+;    ett flertal andra indoeuropeiska språk
 ;
 ;  HUS
-;    fornsvenska isländska <hús>; gemensamt germanskt ord (tyska
-;    <Haus>, engelska <house>) av dunkelt ursprung; jämför [hos],
+;    fornsvenska isländska <hús>; gemensamt germanskt ord (tyska
+;    <Haus>, engelska <house>) av dunkelt ursprung; jämför [hos],
 ;    [hysa]
 ;
-;  KIRUNA samiska <giron>, fjällripa
+;  KIRUNA samiska <giron>, fjällripa
 ;
-;  KÖPING (källa: Våra ord)
-;    fornsvenska <køpunger> handelsplats; jämför isländska <kaupangr>,
-;    sammansättning av [köpa] och <-angr> (fornsvenska <-anger>) äng,
-;    gräsplats
+;  K�PING (källa: Våra ord)
+;    fornsvenska <køpunger> handelsplats; jämför isländska <kaupangr>,
+;    sammansättning av [köpa] och <-angr> (fornsvenska <-anger>) äng,
+;    gräsplats
 ;
-;  JOKK samiska bäck
+;  JOKK samiska bäck
 ;
 ;  OR flodmynning (i till exempel <Orsa>)
 ;
-;  SAL (källa: Våra ord)
-;    fornsvenska <sal>, isländska <salr>; gemensamt germanskt ord
-;    (tyska <Saal>), troligen med grundbetydelsen 'stort hus för
-;    gästabud; boning' (i ortnamn till exempel <Sala>, <Uppsala>)
+;  SAL (källa: Våra ord)
+;    fornsvenska <sal>, isländska <salr>; gemensamt germanskt ord
+;    (tyska <Saal>), troligen med grundbetydelsen 'stort hus för
+;    gästabud; boning' (i ortnamn till exempel <Sala>, <Uppsala>)
 ;
-;  TORP (källa: Våra ord)
-;    fornsvenska isländska <þorp> liten utgård, nyodling; gård, by,
+;  TORP (källa: Våra ord)
+;    fornsvenska isländska <þorp> liten utgård, nyodling; gård, by,
 ;    norska <torp>; gemensamt germanskt ord (tyska <Dorf> by, se
-;    [tölp]), möjligen med grundbetydelsen 'hus'
+;    [tölp]), möjligen med grundbetydelsen 'hus'
 ;
-;  TUN (källa: Våra ord)
-;    gårdsplats (om fornnordiska förhållanden): av isländska <tún>
-;    inhägnad jord, hemmaägor (i svenska ortnamn som <Tuna>, <Sigtuna>
-;    med flera); gemensamt germanskt ord (tyska <Zaun> gärdesgård,
-;    engelska <town> stad) med ursprunglig betydelse 'hägnad,
-;    gärdsgård' (gotländska <tun> gärdsgård) och med motsvarighet i
-;    keltiska språk
-;
-;
-;  Tillordningen namn -> landskap är huvudsakligen gjord enligt
-;  följande:
-;
-;    "holm", "ö" ("a" i Birka), "sjö", "hamn", "sund" -> ocean
-;    "bro", "å" -> river
-;    "ås" -> hills
-;    "köping" -> grassland
+;  TUN (källa: Våra ord)
+;    gårdsplats (om fornnordiska förhållanden): av isländska <tún>
+;    inhägnad jord, hemmaägor (i svenska ortnamn som <Tuna>, <Sigtuna>
+;    med flera); gemensamt germanskt ord (tyska <Zaun> gärdesgård,
+;    engelska <town> stad) med ursprunglig betydelse 'hägnad,
+;    gärdsgård' (gotländska <tun> gärdsgård) och med motsvarighet i
+;    keltiska språk
+;
+;
+;  Tillordningen namn -> landskap är huvudsakligen gjord enligt
+;  följande:
+;
+;    "holm", "ö" ("a" i Birka), "sjö", "hamn", "sund" -> ocean
+;    "bro", "Ã¥" -> river
+;    "Ã¥s" -> hills
+;    "köping" -> grassland
 ;
 ; */ <-- avoid gettext warnings
 
 cities =
  "Stockholm (ocean)", "Uppsala", "Sollentuna", "Sigtuna",
- "Birka (ocean)", "Norrköping (grassland)", "Linköping (grassland)",
- "Örebro (river)", "Gävle", "Västerås (hills)", "Göteborg",
- "Karlstad", "Växjö (ocean)", "Kalmar", "Visby", "Malmö (ocean)",
- "Helsingborg", "Ystad",  "Lund", "Luleå (river)",
- "Kiruna (mountains)", "Halmstad", "Östersund (ocean)",
- "Nyköping (grassland)", "Söderhamn (ocean)", "Sundsvall (ocean)",
- "Piteå (river)", "Skellefteå (river)", "Umeå (river)",
- "Jönköping (grassland)", "Kristianstad",
- "Karlskrona", "Mora", "Oskarshamn (ocean)", "Hässleholm (ocean)",
- "Falun", "Viborg", "Holmgård (ocean)", "Orsa (ocean, river)",
- "Trollhättan", "Jokkmokk (river)"
+ "Birka (ocean)", "Norrköping (grassland)", "Linköping (grassland)",
+ "�rebro (river)", "Gävle", "Västerås (hills)", "Göteborg",
+ "Karlstad", "Växjö (ocean)", "Kalmar", "Visby", "Malmö (ocean)",
+ "Helsingborg", "Ystad",  "Lund", "Luleå (river)",
+ "Kiruna (mountains)", "Halmstad", "Ã?stersund (ocean)",
+ "Nyköping (grassland)", "Söderhamn (ocean)", "Sundsvall (ocean)",
+ "Piteå (river)", "Skellefteå (river)", "Umeå (river)",
+ "Jönköping (grassland)", "Kristianstad",
+ "Karlskrona", "Mora", "Oskarshamn (ocean)", "Hässleholm (ocean)",
+ "Falun", "Viborg", "Holmgård (ocean)", "Orsa (ocean, river)",
+ "Trollhättan", "Jokkmokk (river)"
Index: data/nation/swiss.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/swiss.ruleset,v
retrieving revision 1.3
diff -u -r1.3 swiss.ruleset
--- data/nation/swiss.ruleset   24 Jul 2004 12:26:06 -0000      1.3
+++ data/nation/swiss.ruleset   25 Aug 2004 16:20:51 -0000
@@ -21,13 +21,13 @@
 government="Democracy"
 
 cities =
-  "Bern (river)", "Zürich", "Basel (river)", "Genève", "Lausanne",
+  "Bern (river)", "Zürich", "Basel (river)", "Genève", "Lausanne",
   "Winterthur", "St. Gallen", "Luzern", "Biel / Bienne", "Thun (river)",
-  "Köniz", "La Chaux-de-Fonds", "Fribourg (river)", "Schaffhausen (river)",
+  "Köniz", "La Chaux-de-Fonds", "Fribourg (river)", "Schaffhausen (river)",
   "Neuchatel", "Chur", "Vernier GE", "Emmen LU", "Sion (river)", "Lugano",
   "Uster ZH", "Kriens LU", "Lancy GE", "Montreux VD",
   "Yverdon-les-bains VD (river)",
-  "Zug", "Dietikon ZH", "Dübendorf ZH", "Frauenfeld TG", "Riehen BS",
+  "Zug", "Dietikon ZH", "Dübendorf ZH", "Frauenfeld TG", "Riehen BS",
   "Aarau (river)", "Herisau", "Appenzell", "Liestal", "Glarus",
   "Delemont", "Stans", "Sarnen", "Schwyz",
   "Solothurn (river)", "Bellinzona", "Altdorf"
Index: data/nation/turk.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/turk.ruleset,v
retrieving revision 1.8
diff -u -r1.8 turk.ruleset
--- data/nation/turk.ruleset    24 Jul 2004 12:26:06 -0000      1.8
+++ data/nation/turk.ruleset    25 Aug 2004 16:20:51 -0000
@@ -7,7 +7,7 @@
 collapsed and was dismembered by the victors in World War I after backing \
 the Central Powers.  The country was subsequently reformed and secularized \
 by Kemal Mustapha, the hero of the defense of Gallipoli.")
-leader="Kemal Atatürk", "Süleyman", "Osman", "Murat",
+leader="Kemal Atatürk", "Süleyman", "Osman", "Murat",
        "Selim", "Mehmet"
 leader_sex="Male", "Male", "Male", "Male",
            "Male", "Male"
Index: data/nation/viking.ruleset
===================================================================
RCS file: /home/freeciv/CVS/freeciv/data/nation/viking.ruleset,v
retrieving revision 1.12
diff -u -r1.12 viking.ruleset
--- data/nation/viking.ruleset  24 Jul 2004 12:26:06 -0000      1.12
+++ data/nation/viking.ruleset  25 Aug 2004 16:20:51 -0000
@@ -6,14 +6,14 @@
 legend=_("The Vikings raided and traded along the coasts of Europe \
 between 800AD and 1100AD. Viking raiders eventually became the rulers of \
 Normandy, Russia, and a short-lived kingdom in Sicily.")
-leader="Erik Blodøks",
-       "Harald Hårfagre",
+leader="Erik Blodøks",
+       "Harald HÃ¥rfagre",
        "Sigurd Jorsalfar",
-       "Magnus Berrføtt",
+       "Magnus Berrføtt",
        "Haakon VII",
        "Aud Ivarsdottir",
        "Hrolf Gangr",
-       "Magnus Lagabøter",
+       "Magnus Lagabøter",
        "Olav den Hellige",
        "Rollo",
        "Gro Harlem Brundtland",
@@ -47,22 +47,22 @@
 
 cities =
 "Oslo (ocean)", "Bergen (ocean)", "Kaupang", "Stavanger (ocean)",
-"Nidaros", "Narvik", "Tromsø", "Reykjavik (ocean)", "Harstad", 
-"Fagernes (ocean)", "Tønsberg", "Kirkenes", "Hamar", "Fredrikstad", 
+"Nidaros", "Narvik", "Tromsø", "Reykjavik (ocean)", "Harstad", 
+"Fagernes (ocean)", "Tønsberg", "Kirkenes", "Hamar", "Fredrikstad", 
 "Kristansand (ocean)", "Kristiansund (ocean)", "Christiania", "Drammen", 
-"Sandnes", "Arendal", "Vardø (ocean)", "Vadsø (ocean)", "Haugesund", 
-"Sarpsborg", "Kongsberg", "Kongsvinger", "Gjøvik (river)", "Bardufoss", 
-"Skjold", "Setermoen (hills)", "Lillehammer (river)", "Lillestrøm", 
-"Strømmen", "Fredrikborg", "Halden", "Karmøy", "Kragerø", "Fauske", 
-"Bodø (ocean)", "Andenes (ocean)", "Stokkmarknes", "Svolvær (ocean)", 
-"Sortland", "Moss (ocean)", "Honningsvåg (ocean)", "Hammerfest (ocean)", 
-"Ås (hills)", "Os", "Tynset", "Longyearbyen", "Mandal", "Molde (ocean)", 
-"Ålesund (ocean)", "Oppdal (hills)", "Rjukan", "Porsgrunn",
+"Sandnes", "Arendal", "Vardø (ocean)", "Vadsø (ocean)", "Haugesund", 
+"Sarpsborg", "Kongsberg", "Kongsvinger", "Gjøvik (river)", "Bardufoss", 
+"Skjold", "Setermoen (hills)", "Lillehammer (river)", "Lillestrøm", 
+"Strømmen", "Fredrikborg", "Halden", "Karmøy", "Kragerø", "Fauske", 
+"Bodø (ocean)", "Andenes (ocean)", "Stokkmarknes", "Svolvær (ocean)", 
+"Sortland", "Moss (ocean)", "Honningsvåg (ocean)", "Hammerfest (ocean)", 
+"Ã?s (hills)", "Os", "Tynset", "Longyearbyen", "Mandal", "Molde (ocean)", 
+"Ã?lesund (ocean)", "Oppdal (hills)", "Rjukan", "Porsgrunn",
 
-; Eg skal ikkje gløyme kvelden, det var ein augustikveld,
-; Vårherre heldt fest for folket i Fjaler prestegjeld,
+; Eg skal ikkje gløyme kvelden, det var ein augustikveld,
+; VÃ¥rherre heldt fest for folket i Fjaler prestegjeld,
 ;  - Bergens stift, som det heitte, - Ytre Sunnfjord provsti.
-; Gud unne oss alle nåden når timen vår er forbi.
+; Gud unne oss alle nåden når timen vår er forbi.
 ;
 ; Jakob Sande 1954
 ; added to Freeciv by Gaute Strokkenes RCNUWC 96-98
Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.182
diff -u -r1.182 srv_main.c
--- server/srv_main.c   21 Aug 2004 18:32:37 -0000      1.182
+++ server/srv_main.c   25 Aug 2004 16:20:51 -0000
@@ -49,6 +49,7 @@
 #include "city.h"
 #include "dataio.h"
 #include "events.h"
+#include "fciconv.h"
 #include "fcintl.h"
 #include "game.h"
 #include "log.h"
@@ -184,6 +185,9 @@
   /* mark as initialized */
   has_been_srv_init = TRUE;
 
+  /* init character encodings. */
+  init_character_encodings(DEFAULT_DATA_ENCODING);
+
   /* done */
   return;
 }
Index: utility/Makefile.am
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- utility/Makefile.am 18 Aug 2004 05:24:46 -0000      1.5
+++ utility/Makefile.am 25 Aug 2004 16:20:51 -0000
@@ -13,6 +13,8 @@
                astring.h       \
                capability.c    \
                capability.h    \
+               fciconv.c       \
+               fciconv.h       \
                fcintl.c        \
                fcintl.h        \
                genlist.c       \
Index: utility/fciconv.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/fciconv.c,v
retrieving revision 1.1
diff -u -r1.1 fciconv.c
--- utility/fciconv.c   26 Apr 2004 02:13:30 -0000      1.1
+++ utility/fciconv.c   25 Aug 2004 16:20:51 -0000
@@ -0,0 +1,272 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 2003-2004 - The Freeciv Project
+   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
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef HAVE_ICONV
+#include <iconv.h>
+#endif
+
+#ifdef HAVE_LANGINFO_CODESET
+#include <langinfo.h>
+#endif
+
+#include "fciconv.h"
+#include "fcintl.h"
+#include "log.h"
+#include "mem.h"
+#include "support.h"
+
+static bool is_init = FALSE;
+static char convert_buffer[4096];
+
+#ifdef HAVE_ICONV
+static char *local_encoding, *data_encoding, *internal_encoding;
+#endif
+
+/***************************************************************************
+  Must be called during the initialization phase of server and client to
+  initialize the character encodings to be used.
+***************************************************************************/
+void init_character_encodings(char *my_internal_encoding)
+{
+#ifdef HAVE_ICONV
+  /* Set the data encoding - first check $FREECIV_DATA_ENCODING,
+   * then fall back to the default. */
+  data_encoding = getenv("FREECIV_DATA_ENCODING");
+  if (!data_encoding) {
+    /* Currently the rulesets are in latin1 (ISO-8859-1). */
+    data_encoding = DEFAULT_DATA_ENCODING;
+  }
+
+  /* Set the local encoding - first check $FREECIV_LOCAL_ENCODING,
+   * then ask the system. */
+  local_encoding = getenv("FREECIV_LOCAL_ENCODING");
+  if (!local_encoding) {
+#ifdef HAVE_LIBCHARSET
+    local_encoding = locale_charset();
+#else
+#ifdef HAVE_LANGINFO_CODESET
+    local_encoding = nl_langinfo(CODESET);
+#else
+    local_encoding = "";
+#endif
+#endif
+    if (strcasecmp(local_encoding, "ANSI_X3.4-1968") == 0
+       || strcasecmp(local_encoding, "ASCII") == 0) {
+      /* HACK: use latin1 instead of ascii in typical cases when the
+       * encoding is unconfigured. */
+      local_encoding = "ISO-8859-1";
+    }
+  }
+
+  /* Set the internal encoding - first check $FREECIV_INTERNAL_ENCODING,
+   * then check the passed-in default value, then fall back to the local
+   * encoding. */
+  internal_encoding = getenv("FREECIV_INTERNAL_ENCODING");
+  if (!internal_encoding) {
+    internal_encoding = my_internal_encoding;
+
+    if (!internal_encoding) {
+      internal_encoding = local_encoding;
+    }
+  }
+
+#ifdef ENABLE_NLS
+  bind_textdomain_codeset(PACKAGE, internal_encoding);
+#endif
+
+  fprintf(stderr, "Data=%s, Local=%s, Internal=%s\n",
+            data_encoding, local_encoding, internal_encoding);
+#else
+   /* freelog may not work at this point. */
+  fprintf(stderr,
+            _("You are running Freeciv without using iconv.  Unless\n"
+              "you are using the latin1 character set, some characters\n"
+              "may not be displayed properly.  You can download iconv\n"
+              "at http://gnu.org/.\n";));
+#endif
+
+  is_init = TRUE;
+}
+
+const char *get_data_encoding(void)
+{
+  assert(is_init);
+  return data_encoding;
+}
+
+const char *get_local_encoding(void)
+{
+  assert(is_init);
+  return local_encoding;
+}
+
+const char *get_internal_encoding(void)
+{
+  assert(is_init);
+  return internal_encoding;
+}
+
+/***************************************************************************
+  Convert the text.  Both 'from' and 'to' must be 8-bit charsets.  The
+  result will be put into the buf buffer unless it is NULL, in which case it
+  will be allocated on demand.
+***************************************************************************/
+static char *convert_string(const char *text,
+                           const char *from,
+                           const char *to,
+                           char *buf, size_t bufsz)
+{
+#ifdef HAVE_ICONV
+  iconv_t cd = iconv_open(to, from);
+  size_t from_len = strlen(text) + 1, to_len;
+  bool alloc = (buf == NULL);
+
+  assert(is_init && from != NULL && to != NULL);
+  assert(text != NULL);
+
+  if (cd == (iconv_t) (-1)) {
+    freelog(LOG_ERROR,
+           _("Could not convert text from %s to %s: %s"),
+           from, to, strerror(errno));
+    /* The best we can do? */
+    if (alloc) {
+      return mystrdup(text);
+    } else {
+      my_snprintf(buf, bufsz, "%s", text);
+      return buf;
+    }
+  }
+
+  if (alloc) {
+    to_len = from_len;
+  } else {
+    to_len = bufsz;
+  }
+
+  do {
+    size_t flen = from_len, tlen = to_len, res;
+    const char *mytext = text;
+    char *myresult;
+
+    if (alloc) {
+      buf = fc_malloc(to_len);
+    }
+
+    myresult = buf;
+
+    /* Since we may do multiple translations, we may need to reset iconv
+     * in between. */
+    iconv(cd, NULL, NULL, NULL, NULL);
+
+    res = iconv(cd, (char**)&mytext, &flen, &myresult, &tlen);
+    if (res == (size_t) (-1)) {
+      if (errno != E2BIG) {
+       /* Invalid input. */
+       freelog(LOG_ERROR, "Invalid string conversion from %s to %s.",
+               from, to);
+       iconv_close(cd);
+       if (alloc) {
+         free(buf);
+         return mystrdup(text); /* The best we can do? */
+       } else {
+         my_snprintf(buf, bufsz, "%s", text);
+         return buf;
+       }
+      }
+    } else {
+      /* Success. */
+      iconv_close(cd);
+
+      /* There may be wasted space here, but there's nothing we can do
+       * about it. */
+      return buf;
+    }
+
+    if (alloc) {
+      /* Not enough space; try again. */
+      buf[to_len - 1] = 0;
+      freelog(LOG_VERBOSE, "   Result was '%s'.", buf);
+
+      free(buf);
+      to_len *= 2;
+    }
+  } while (alloc);
+
+  return buf;
+#else /* HAVE_ICONV */
+  if (buf) {
+    strncpy(buf, text, bufsz);
+    buf[bufsz - 1] = '\0';
+  } else {
+    return mystrdup(text);
+  }
+#endif /* HAVE_ICONV */
+}
+
+#define CONV_FUNC_MALLOC(src, dst)                                          \
+char *src ## _to_ ## dst ## _string_malloc(const char *text)                \
+{                                                                           \
+  return convert_string(text, (src ## _encoding),                          \
+                       (dst ## _encoding), NULL, 0);                       \
+}
+
+#define CONV_FUNC_BUFFER(src, dst)                                          \
+char *src ## _to_ ## dst ## _string_buffer(const char *text,                \
+                                          char *buf, size_t bufsz)         \
+{                                                                           \
+  return convert_string(text, (src ## _encoding),                          \
+                        (dst ## _encoding), buf, bufsz);                    \
+}
+
+#define CONV_FUNC_STATIC(src, dst)                                          \
+char *src ## _to_ ## dst ## _string_static(const char *text)                \
+{                                                                           \
+  (src ## _to_ ## dst ## _string_buffer)(text,                              \
+                                       convert_buffer,                     \
+                                       sizeof(convert_buffer));            \
+  return convert_buffer;                                                    \
+}
+
+CONV_FUNC_MALLOC(data, internal)
+CONV_FUNC_MALLOC(internal, data)
+
+static CONV_FUNC_BUFFER(internal, local)
+static CONV_FUNC_STATIC(internal, local)
+
+/***************************************************************************
+  Do a printf in the currently bound codeset.
+***************************************************************************/
+void fc_fprintf(FILE *stream, const char *format, ...)
+{
+  va_list ap;
+  char string[4096];
+  const char *output;
+
+  va_start(ap, format);
+  my_vsnprintf(string, sizeof(string), format, ap);
+  va_end(ap);
+
+  output = internal_to_local_string_static(string);
+
+  fputs(output, stream);
+  fflush(stream);
+}
Index: utility/fciconv.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/fciconv.h,v
retrieving revision 1.1
diff -u -r1.1 fciconv.h
--- utility/fciconv.h   26 Apr 2004 02:13:30 -0000      1.1
+++ utility/fciconv.h   25 Aug 2004 16:20:51 -0000
@@ -0,0 +1,32 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 2003-2004 - The Freeciv Project
+   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
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+#ifndef FC__FCICONV_H
+#define FC__FCICONV_H
+
+#include "shared.h"
+
+#define DEFAULT_DATA_ENCODING "UTF-8"
+
+void init_character_encodings(char *internal_encoding);
+
+const char *get_data_encoding(void);
+const char *get_local_encoding(void);
+const char *get_internal_encoding(void);
+
+char *data_to_internal_string_malloc(const char *text);
+char *internal_to_data_string_malloc(const char *text);
+
+void fc_fprintf(FILE *stream, const char *format, ...)
+      fc__attribute((format (printf, 2, 3)));
+
+#endif /* FC__FCICONV_H */
Index: utility/log.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/log.c,v
retrieving revision 1.45
diff -u -r1.45 log.c
--- utility/log.c       10 Apr 2004 03:47:49 -0000      1.45
+++ utility/log.c       25 Aug 2004 16:20:51 -0000
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "fciconv.h"
 #include "fcintl.h"
 #include "mem.h"
 #include "shared.h"
@@ -80,16 +81,16 @@
   }
   if (n == 0) {
     if (sscanf(level_str, "%d", &level) != 1) {
-      fprintf(stderr, _("Bad log level \"%s\".\n"), level_str);
+      fc_fprintf(stderr, _("Bad log level \"%s\".\n"), level_str);
       return -1;
     }
     if (level >= LOG_FATAL && level <= max_level) {
       return level;
     } else {
-      fprintf(stderr, _("Bad log level %d in \"%s\".\n"), level, level_str);
+      fc_fprintf(stderr, _("Bad log level %d in \"%s\".\n"), level, level_str);
       if (level == LOG_DEBUG && max_level < LOG_DEBUG) {
-       fprintf(stderr, _("Freeciv must be compiled with the DEBUG flag"
-                         " to use debug level %d.\n"), LOG_DEBUG);
+       fc_fprintf(stderr, _("Freeciv must be compiled with the DEBUG flag"
+                            " to use debug level %d.\n"), LOG_DEBUG);
       }
       return -1;
     }
@@ -99,12 +100,13 @@
   if (c[0] == ('0' + LOG_DEBUG) && c[1] == ':') {
     level = LOG_DEBUG;
     if (max_level < LOG_DEBUG) {
-      fprintf(stderr, _("Freeciv must be compiled with the DEBUG flag"
-                       " to use debug level %d.\n"), LOG_DEBUG);
+      fc_fprintf(stderr, _("Freeciv must be compiled with the DEBUG flag"
+                          " to use debug level %d.\n"), LOG_DEBUG);
       return -1;
     }
   } else {
-    fprintf(stderr, _("Badly formed log level argument \"%s\".\n"), level_str);
+    fc_fprintf(stderr, _("Badly formed log level argument \"%s\".\n"),
+              level_str);
     return -1;
   }
   logd_num_files = n;
@@ -115,7 +117,8 @@
   tok = strtok(dup, ":");
   
   if (!tok) {
-    fprintf(stderr, _("Badly formed log level argument \"%s\".\n"), level_str);
+    fc_fprintf(stderr, _("Badly formed log level argument \"%s\".\n"),
+              level_str);
     level = -1;
     goto out;
   }
@@ -132,20 +135,20 @@
       if (d && *pc != '\0' && d[1] != '\0') {
        d[0] = '\0';
        if (sscanf(pc, "%d", &logd_files[i].min) != 1) {
-         fprintf(stderr, _("Not an integer: '%s'\n"), pc);
+         fc_fprintf(stderr, _("Not an integer: '%s'\n"), pc);
          level = -1;
          goto out;
        }
        if (sscanf(d + 1, "%d", &logd_files[i].max) != 1) {
-         fprintf(stderr, _("Not an integer: '%s'\n"), d + 1);
+         fc_fprintf(stderr, _("Not an integer: '%s'\n"), d + 1);
          level = -1;
          goto out;
        }
       }
     }
     if(strlen(tok)==0) {
-      fprintf(stderr, _("Empty filename in log level argument \"%s\".\n"),
-             level_str);
+      fc_fprintf(stderr, _("Empty filename in log level argument \"%s\".\n"),
+                level_str);
       level = -1;
       goto out;
     }
@@ -155,7 +158,8 @@
   } while(tok);
 
   if (i!=logd_num_files) {
-    fprintf(stderr, _("Badly formed log level argument \"%s\".\n"), level_str);
+    fc_fprintf(stderr, _("Badly formed log level argument \"%s\".\n"),
+              level_str);
     level = -1;
     goto out;
   }
@@ -236,7 +240,7 @@
     log_callback(level, message);
   }
   if (log_filename || (!log_callback)) {
-    fprintf(fs, "%d: %s\n", level, message);
+    fc_fprintf(fs, "%d: %s\n", level, message);
     fflush(fs);
   }
 }
@@ -264,7 +268,7 @@
 
     if (log_filename) {
       if(!(fs=fopen(log_filename, "a"))) {
-       fprintf(stderr, _("Couldn't open logfile: %s for appending.\n"), 
+       fc_fprintf(stderr, _("Couldn't open logfile: %s for appending.\n"), 
                log_filename);
        exit(EXIT_FAILURE);
       }

[Prev in Thread] Current Thread [Next in Thread]