Commits

Chris Beaven committed c68b7e2

Fix the unicode encoding and bump the version again.

Comments (0)

Files changed (3)

django_countries/bin/regenerate.py

     with the basic English letter equivalent.
 
     """
-    value = value.replace(u'\u0439', 'e').replace(u'\u0444', 'o')
-    if value.startswith(u'\u0415'):
-        value = 'A%s' % value[1:]
-    if value.startswith(u'\u0415'):
+    value = value.replace(u'\xe9', 'e').replace(u'\xf4', 'o')
+    if value.startswith(u'\xc5'):
         value = 'A%s' % value[1:]
     return value
 
 
 def regenerate(location='http://www.iso.org/iso/list-en1-semic-3.txt',
-               filename=None, default_encoding='windows-1251'):
+               filename=None, default_encoding='ISO-8859-1'):
     """
     Generate the countries Python module from a semicolon delimited file.
     

django_countries/countries.py

 # Nicely titled (and translatable) country names.
 COUNTRIES = (
     ('AF', _(u'Afghanistan')),
-    ('AX', _(u'\u0415land Islands')),
+    ('AX', _(u'\xc5land Islands')),
     ('AL', _(u'Albania')),
     ('DZ', _(u'Algeria')),
     ('AS', _(u'American Samoa')),
     ('CD', _(u'Congo, The Democratic Republic of the')),
     ('CK', _(u'Cook Islands')),
     ('CR', _(u'Costa Rica')),
-    ('CI', _(u"C\u0444te D'ivoire")),
+    ('CI', _(u"C\xf4te D'ivoire")),
     ('HR', _(u'Croatia')),
     ('CU', _(u'Cuba')),
     ('CY', _(u'Cyprus')),
     ('PT', _(u'Portugal')),
     ('PR', _(u'Puerto Rico')),
     ('QA', _(u'Qatar')),
-    ('RE', _(u'R\u0439union')),
+    ('RE', _(u'R\xe9union')),
     ('RO', _(u'Romania')),
     ('RU', _(u'Russian Federation')),
     ('RW', _(u'Rwanda')),
-    ('BL', _(u'Saint Barth\u0439lemy')),
+    ('BL', _(u'Saint Barth\xe9lemy')),
     ('SH', _(u'Saint Helena')),
     ('KN', _(u'Saint Kitts and Nevis')),
     ('LC', _(u'Saint Lucia')),
 # (containing the non-comma'd version).
 COUNTRIES_PLUS = (
     ('AF', _(u'Afghanistan')),
-    ('AX', _(u'\u0415land Islands')),
+    ('AX', _(u'\xc5land Islands')),
     ('AL', _(u'Albania')),
     ('DZ', _(u'Algeria')),
     ('AS', _(u'American Samoa')),
     ('CD', _(u'Congo, The Democratic Republic of the')),
     ('CK', _(u'Cook Islands')),
     ('CR', _(u'Costa Rica')),
-    ('CI', _(u"C\u0444te D'ivoire")),
+    ('CI', _(u"C\xf4te D'ivoire")),
     ('HR', _(u'Croatia')),
     ('CU', _(u'Cuba')),
     ('CY', _(u'Cyprus')),
     ('QA', _(u'Qatar')),
     ('KR', _(u'Republic of Korea')),
     ('MD', _(u'Republic of Moldova')),
-    ('RE', _(u'R\u0439union')),
+    ('RE', _(u'R\xe9union')),
     ('RO', _(u'Romania')),
     ('RU', _(u'Russian Federation')),
     ('RW', _(u'Rwanda')),
-    ('BL', _(u'Saint Barth\u0439lemy')),
+    ('BL', _(u'Saint Barth\xe9lemy')),
     ('SH', _(u'Saint Helena')),
     ('KN', _(u'Saint Kitts and Nevis')),
     ('LC', _(u'Saint Lucia')),
 # Official capitalized country names.
 OFFICIAL_COUNTRIES = {
     'AF': u'AFGHANISTAN',
-    'AX': u'\u0415LAND ISLANDS',
+    'AX': u'\xc5LAND ISLANDS',
     'AL': u'ALBANIA',
     'DZ': u'ALGERIA',
     'AS': u'AMERICAN SAMOA',
     'CD': u'CONGO, THE DEMOCRATIC REPUBLIC OF THE',
     'CK': u'COOK ISLANDS',
     'CR': u'COSTA RICA',
-    'CI': u"C\u0424TE D'IVOIRE",
+    'CI': u"C\xd4TE D'IVOIRE",
     'HR': u'CROATIA',
     'CU': u'CUBA',
     'CY': u'CYPRUS',
     'PT': u'PORTUGAL',
     'PR': u'PUERTO RICO',
     'QA': u'QATAR',
-    'RE': u'R\u0419UNION',
+    'RE': u'R\xc9UNION',
     'RO': u'ROMANIA',
     'RU': u'RUSSIAN FEDERATION',
     'RW': u'RWANDA',
-    'BL': u'SAINT BARTH\u0419LEMY',
+    'BL': u'SAINT BARTH\xc9LEMY',
     'SH': u'SAINT HELENA',
     'KN': u'SAINT KITTS AND NEVIS',
     'LC': u'SAINT LUCIA',
 from setuptools import setup, find_packages
 
 setup(name='django-countries',
-      version='1.0a2',
+      version='1.0a3',
       description='Provides a country field for Django models.',
       author='Chris Beaven',
       author_email='smileychris@gmail.com',