Index: django/utils/html.py
===================================================================
--- django/utils/html.py	(revision 6780)
+++ django/utils/html.py	(working copy)
@@ -100,7 +100,7 @@
             if safe_input:
                 middle = mark_safe(middle)
             if middle.startswith('www.') or ('@' not in middle and not middle.startswith('http://') and \
-                    len(middle) > 0 and middle[0] in string.letters + string.digits and \
+                    len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \
                     (middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
                 middle = '<a href="http://%s"%s>%s</a>' % (
                         urlquote(middle, safe='/&=:;#?+'),  nofollow_attr,
Index: tests/regressiontests/utils/tests.py
===================================================================
--- tests/regressiontests/utils/tests.py	(revision 6780)
+++ tests/regressiontests/utils/tests.py	(working copy)
@@ -123,6 +123,45 @@
         for value, output in items:
             self.check_output(f, value, output)
 
+    def test_urlize(self):
+        cases = (('abc', u'abc', {}),
+                 # simple case
+                 ('www.example.com',
+                  u'<a href="http://www.example.com">www.example.com</a>',
+                  {}),
+                 # simple case with nofollow
+                 ('www.example.com',
+                  u'<a href="http://www.example.com" rel="nofollow">www.example.com</a>',
+                  {'nofollow': True}),
+                 # wrapped in parens
+                 ('(www.example.com)',
+                  u'(<a href="http://www.example.com">www.example.com</a>)',
+                  {}),
+                 # text plus url
+                 ('Check out this link: http://www.example.com/foo',
+                  u'Check out this link: <a href="http://www.example.com/foo">http://www.example.com/foo</a>',
+                  {}),
+                 # trailing punctuation
+                 ('link http://www.example.com/foo, updated weekly',
+                  u'link <a href="http://www.example.com/foo">http://www.example.com/foo</a>, updated weekly',
+                  {}),
+                 ('link http://www.example.com/foo. Updated weekly.',
+                  u'link <a href="http://www.example.com/foo">http://www.example.com/foo</a>. Updated weekly.',
+                  {}),
+                 # mailto
+                 ('mail me user@example.com, we can discuss things',
+                  u'mail me <a href="mailto:user@example.com">user@example.com</a>, we can discuss things', {}),
+                 )
+        for input, expected, arguments in cases:
+            output = html.urlize(input, **arguments)
+            self.assertEquals(output, expected)
+
+        # now validate that changing locales does not break anything
+        import locale
+        locale.setlocale(locale.LC_ALL, 'de_DE')
+        output = html.urlize('abc')
+        self.assertEquals(output, u'abc')
+
 class TestUtilsChecksums(TestCase):
 
     def check_output(self, function, value, output=None):
