From 77d8f64765d88cbe106dd7292c838d728ba698bf Mon Sep 17 00:00:00 2001 From: grubert Date: Tue, 20 Oct 2009 14:30:43 +0000 Subject: [PATCH] Fix: encoding ``'ascii'`` must be lowercase to prevent problems for turkish locale. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@6181 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/HISTORY.txt | 5 +++++ docutils/docutils/nodes.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt index f9aaaa6bb..db99ede1d 100644 --- a/docutils/HISTORY.txt +++ b/docutils/HISTORY.txt @@ -22,6 +22,11 @@ Changes Since 0.6 - use `transforms.writer_aux.Admonitions` to "normalize" special admonitions. +* docutils/nodes.py + + - Fix: encoding ``'ascii'`` must be lowercase to prevent problems for + turkish locale. + Release 0.6 (2009-10-11) ======================== diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index 2904030a9..a68b5450a 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -1840,9 +1840,10 @@ def make_id(string): id = id.decode() id = id.translate(_non_id_translate_digraphs) id = id.translate(_non_id_translate) - # get rid of non-ascii characters + # get rid of non-ascii characters. + # 'ascii' lowercase to prevent problems with turkish locale. id = unicodedata.normalize('NFKD', id).\ - encode('ASCII', 'ignore').decode('ASCII') + encode('ascii', 'ignore').decode('ascii') # shrink runs of whitespace and replace by hyphen id = _non_id_chars.sub('-', ' '.join(id.split())) id = _non_id_at_ends.sub('', id) -- 2.11.4.GIT