<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,15 +1,110 @@
+var LATIN_MAP =
+{
+    '&#192;': 'A', '&#193;': 'A', '&#194;': 'A', '&#195;': 'A', '&#196;': 'A', '&#197;': 'A', '&#198;': 'AE', '&#199;':
+    'C', '&#200;': 'E', '&#201;': 'E', '&#202;': 'E', '&#203;': 'E', '&#204;': 'I', '&#205;': 'I', '&#206;': 'I',
+    '&#207;': 'I', '&#208;': 'D', '&#209;': 'N', '&#210;': 'O', '&#211;': 'O', '&#212;': 'O', '&#213;': 'O', '&#214;':
+    'O', '&#216;': 'O', '&#217;': 'U', '&#218;': 'U', '&#219;': 'U', '&#220;': 'U', '&#221;': 'Y', '&#222;': 'TH',
+    '&#223;': 'ss', '&#224;':'a', '&#225;':'a', '&#226;': 'a', '&#227;': 'a', '&#228;': 'a', '&#229;': 'a', '&#230;':
+    'ae', '&#231;': 'c', '&#232;': 'e', '&#233;': 'e', '&#234;': 'e', '&#235;': 'e', '&#236;': 'i', '&#237;': 'i',
+    '&#238;': 'i', '&#239;': 'i', '&#240;': 'o', '&#241;': 'n', '&#242;': 'o', '&#243;': 'o', '&#244;': 'o', '&#245;':
+    'o', '&#246;': 'o', '&#248;': 'o', '&#249;': 'u', '&#250;': 'u', '&#251;': 'u', '&#252;': 'u', '&#253;': 'y',
+    '&#254;': 'th', '&#255;': 'y',
+}
+var LATIN_SYMBOLS_MAP =
+{
+    '&#169;':'(c)',
+}
+var GREEK_MAP =
+{
+    '&#945;':'a', '&#946;':'b', '&#947;':'g', '&#948;':'d', '&#949;':'e', '&#950;':'z', '&#951;':'h', '&#952;':'8',
+    '&#953;':'i', '&#954;':'k', '&#955;':'l', '&#956;':'m', '&#957;':'n', '&#958;':'3', '&#959;':'o', '&#960;':'p',
+    '&#961;':'r', '&#963;':'s', '&#964;':'t', '&#965;':'y', '&#966;':'f', '&#967;':'x', '&#968;':'ps', '&#969;':'w',
+    '&#940;':'a', '&#941;':'e', '&#943;':'i', '&#972;':'o', '&#973;':'y', '&#942;':'h', '&#974;':'w', '&#962;':'s',
+    '&#970;':'i', '&#944;':'y', '&#971;':'y', '&#912;':'i',
+    '&#913;':'A', '&#914;':'B', '&#915;':'G', '&#916;':'D', '&#917;':'E', '&#918;':'Z', '&#919;':'H', '&#920;':'8',
+    '&#921;':'I', '&#922;':'K', '&#923;':'L', '&#924;':'M', '&#925;':'N', '&#926;':'3', '&#927;':'O', '&#928;':'P',
+    '&#929;':'R', '&#931;':'S', '&#932;':'T', '&#933;':'Y', '&#934;':'F', '&#935;':'X', '&#936;':'PS', '&#937;':'W',
+    '&#902;':'A', '&#904;':'E', '&#906;':'I', '&#908;':'O', '&#910;':'Y', '&#905;':'H', '&#911;':'W', '&#938;':'I',
+    '&#939;':'Y'
+}
+var TURKISH_MAP = {
+    '&#351;':'s', '&#350;':'S', '&#305;':'i', '&#304;':'I', '&#231;':'c', '&#199;':'C', '&#252;':'u', '&#220;':'U',
+    '&#246;':'o', '&#214;':'O', '&#287;':'g', '&#286;':'G',
+}
+// var RUSSIAN_MAP =
+// {
+// }
+
+var ALL_DOWNCODE_MAPS=new Array()
+ALL_DOWNCODE_MAPS[0]=LATIN_MAP
+ALL_DOWNCODE_MAPS[1]=LATIN_SYMBOLS_MAP
+ALL_DOWNCODE_MAPS[2]=GREEK_MAP
+ALL_DOWNCODE_MAPS[3]=TURKISH_MAP
+//ALL_DOWNCODE_MAPS[4]=RUSSIAN_MAP
+
+var Downcoder = new Object();
+Downcoder.Initialize = function()
+{
+    if (Downcoder.map) // already made
+        return ;
+    Downcoder.map ={}
+    Downcoder.chars = '' ;
+    for(var i in ALL_DOWNCODE_MAPS)
+    {
+        var lookup = ALL_DOWNCODE_MAPS[i]
+        for (var c in lookup)
+        {
+            Downcoder.map[c] = lookup[c] ;
+            Downcoder.chars += c ;
+        }
+     }
+    Downcoder.regex = new RegExp('[' + Downcoder.chars + ']|[^' + Downcoder.chars + ']+','g') ;
+}
+
+downcode= function( slug )
+{
+    Downcoder.Initialize() ;
+    var downcoded =&quot;&quot;
+    var pieces = slug.match(Downcoder.regex);
+    if(pieces)
+    {
+        for (var i = 0 ; i &lt; pieces.length ; i++)
+        {
+            if (pieces[i].length == 1)
+            {
+                var mapped = Downcoder.map[pieces[i]] ;
+                if (mapped != null)
+                {
+                    downcoded+=mapped;
+                    continue ;
+                }
+            }
+            downcoded+=pieces[i];
+        }
+    }
+    else
+    {
+        downcoded = slug;
+    }
+    return downcoded;
+}
+
+
 function URLify(s, num_chars) {
     // changes, e.g., &quot;Petty theft&quot; to &quot;petty_theft&quot;
     // remove all these words from the string before urlifying
+    s = downcode(s);
     removelist = [&quot;a&quot;, &quot;an&quot;, &quot;as&quot;, &quot;at&quot;, &quot;before&quot;, &quot;but&quot;, &quot;by&quot;, &quot;for&quot;, &quot;from&quot;,
                   &quot;is&quot;, &quot;in&quot;, &quot;into&quot;, &quot;like&quot;, &quot;of&quot;, &quot;off&quot;, &quot;on&quot;, &quot;onto&quot;, &quot;per&quot;,
                   &quot;since&quot;, &quot;than&quot;, &quot;the&quot;, &quot;this&quot;, &quot;that&quot;, &quot;to&quot;, &quot;up&quot;, &quot;via&quot;,
                   &quot;with&quot;];
     r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');
     s = s.replace(r, '');
+    // if downcode doesn't hit, the char will be stripped here
     s = s.replace(/[^-\w\s]/g, '');  // remove unneeded chars
     s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
     s = s.replace(/[-\s]+/g, '-');   // convert spaces to hyphens
     s = s.toLowerCase();             // convert to lowercase
     return s.substring(0, num_chars);// trim to first num_chars chars
 }
+</diff>
      <filename>django/contrib/admin/media/js/urlify.js</filename>
    </modified>
    <modified>
      <diff>@@ -115,10 +115,13 @@ def make_list(value):
 make_list = stringfilter(make_list)
 
 def slugify(value):
-    &quot;Converts to lowercase, removes non-alpha chars and converts spaces to hyphens&quot;
-    # Don't compile patterns as unicode because \w then would mean any letter.
-    # Slugify is effectively a conversion to ASCII.
-    value = re.sub('[^\w\s-]', '', value).strip().lower()
+    &quot;&quot;&quot;
+    Normalizes string, converts to lowercase, removes non-alpha chars and
+    converts spaces to hyphens.
+    &quot;&quot;&quot;
+    import unicodedata
+    value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
+    value = unicode(re.sub('[^\w\s-]', '', value).strip().lower())
     return re.sub('[-\s]+', '-', value)
 slugify = stringfilter(slugify)
 </diff>
      <filename>django/template/defaultfilters.py</filename>
    </modified>
    <modified>
      <diff>@@ -67,6 +67,9 @@ u'\xeb'
 &gt;&gt;&gt; slugify(' Jack &amp; Jill like numbers 1,2,3 and 4 and silly characters ?%.$!/')
 u'jack-jill-like-numbers-123-and-4-and-silly-characters'
 
+&gt;&gt;&gt; slugify(u&quot;Un \xe9l\xe9phant \xe0 l'or\xe9e du bois&quot;)
+u'un-elephant-a-loree-du-bois'
+
 &gt;&gt;&gt; stringformat(1, u'03d')
 u'001'
 </diff>
      <filename>tests/regressiontests/defaultfilters/tests.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5a30968a56d6f1159f79cea1c8ae73a4ed8d3025</id>
    </parent>
  </parents>
  <author>
    <name>mtredinnick</name>
    <email>mtredinnick@bcc190cf-cafb-0310-a4f2-bffc1f526a37</email>
  </author>
  <url>http://github.com/tswicegood/django/commit/0279e68a43c817f26664c3f9d8323e85ff50ee8e</url>
  <id>0279e68a43c817f26664c3f9d8323e85ff50ee8e</id>
  <committed-date>2007-07-04T02:28:29-07:00</committed-date>
  <authored-date>2007-07-04T02:28:29-07:00</authored-date>
  <message>unicode: Added unicode-aware slugify filter (in Python) and better non-ASCII
handling for the Javascript slug creator in admin. Can never be perfect here,
but this is more tolerant in many cases. Fixed #4365. Thanks, Bill de h&#211;ra,
Baptiste, orestis@orestis.gr, Ahmet and Jonas for contributions to this.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5608 bcc190cf-cafb-0310-a4f2-bffc1f526a37</message>
  <tree>7e8ef34cb859f3deb73872abc20aa50499dde4df</tree>
  <committer>
    <name>mtredinnick</name>
    <email>mtredinnick@bcc190cf-cafb-0310-a4f2-bffc1f526a37</email>
  </committer>
</commit>
