Index: doc/styles/rules-filters.txt
===================================================================
--- doc/styles/rules-filters.txt	(revision 3357)
+++ doc/styles/rules-filters.txt	(working copy)
@@ -97,6 +97,16 @@
 
 `${ele\|height:"m=>ft"}`
 
+| country-ISO |  |
+Use to normalize country names to the 3 character ISO 1366 code.
+The filter has no arguments. It uses the list in LocatorConfig.xml.
+Possible arguments are country names, or ISO codes in 2 or 3 characters,
+for example "Deutschland", "Germany", "Bundesrepublik Deutschland", or "DE" 
+will all return "DEU", also different cases like "GERMAYN" or "   germany " 
+will work.
+ 
+If the value is not found in the list, then the value is unchanged.
+
 | not-equal | `tag` |
 Used to check for duplicate tags. If the value of this tag is equal to
 the value of the tag named as the argument to +not-equal+, then value
Index: resources/styles/default/inc/address
===================================================================
--- resources/styles/default/inc/address	(revision 3357)
+++ resources/styles/default/inc/address	(working copy)
@@ -5,8 +5,8 @@
 
 # first set the country code
 mkgmap:country!=* & mkgmap:admin_level2=* { set mkgmap:country='${mkgmap:admin_level2}' }
-mkgmap:country!=* & addr:country=* { set mkgmap:country='${addr:country}' }
-mkgmap:country!=* & is_in:country=* { set mkgmap:country='${is_in:country}' }
+mkgmap:country!=* & addr:country=* { set mkgmap:country='${addr:country|country-ISO:}' }
+mkgmap:country!=* & is_in:country=* { set mkgmap:country='${is_in:country|country-ISO:}' }
 
 # country specific rules first
 
Index: src/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilter.java	(revision 0)
+++ src/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilter.java	(working copy)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 or
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+package uk.me.parabola.mkgmap.osmstyle.actions;
+
+import uk.me.parabola.mkgmap.build.LocatorConfig;
+import uk.me.parabola.mkgmap.reader.osm.Element;
+
+/**
+ * Convert a string containing a country name or ISO string to the 3 character ISO string.
+ * Samples: Deutschland->DEU, UK->GBR
+ *
+ * @author GerdP
+ */
+public class CountryISOFilter extends ValueFilter {
+
+	public CountryISOFilter() {
+	}
+
+	protected String doFilter(String value, Element el) {
+		if (value == null)
+			return value;
+		String s = LocatorConfig.get().getCountryISOCode(value);
+		if (s != null)
+			return s;
+		else 
+			return value;
+	}
+}
Index: src/uk/me/parabola/mkgmap/osmstyle/actions/ValueBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/actions/ValueBuilder.java	(revision 3357)
+++ src/uk/me/parabola/mkgmap/osmstyle/actions/ValueBuilder.java	(working copy)
@@ -225,6 +225,9 @@
 		case "part":
 			item.addFilter(new PartFilter(arg));
 			break;
+		case "country-ISO":
+			item.addFilter(new CountryISOFilter());
+			break;
 		default:
 			throw new SyntaxException(String.format("Unknown filter '%s'", cmd));
 		}
Index: test/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilterTest.java
===================================================================
--- test/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilterTest.java	(revision 0)
+++ test/uk/me/parabola/mkgmap/osmstyle/actions/CountryISOFilterTest.java	(working copy)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 or
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+/* Create date: 28-Nov-2014 */
+package uk.me.parabola.mkgmap.osmstyle.actions;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * 
+ * @author GerdP
+ *
+ */
+public class CountryISOFilterTest {
+	/**
+	 * Test different inputs for the country-ISO filter
+	 */
+	@Test
+	public void testDoFilter() {
+		CountryISOFilter filter = new CountryISOFilter();
+		String s;
+		s = filter.doFilter("Germany", null);
+		assertEquals("Germany", "DEU", s);
+		s = filter.doFilter("Deutschland", null);
+		assertEquals("Deutschland", "DEU", s);
+		s = filter.doFilter("United Kingdom", null);
+		assertEquals("United Kingdom", "GBR", s);
+		s = filter.doFilter("UNITED KINGDOM", null);
+		assertEquals("UNITED KINGDOM", "GBR", s);
+		s = filter.doFilter("united kingdom", null);
+		assertEquals("united kingdom", "GBR", s);
+		s = filter.doFilter("UK", null);
+		assertEquals("UK", "GBR", s);
+		s = filter.doFilter("xyz", null);
+		assertEquals("xyz", "xyz", s);
+		s = filter.doFilter("Ελλάδα", null);
+		assertEquals("Ελλάδα", "GRC", s);
+		s = filter.doFilter("  germany ", null);
+		assertEquals("  germany ", "DEU", s);
+
+	
+	}
+
+}
