rohitjain-rj / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

handling Japanese punctuation #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
My site needs to be able to accept tags in Japanese, however django-tagging
doesn't recognize the special characters for spaces, commas, and quotes in
that language.

This patch adds a bit of code to tagging.utils.parse_tag_input.  It looks
for settings.TAGGING_NONASCII_ASCII, which should be a list of (non-ASCII,
ASCII) tuples, like the following:

  TAGGING_NONASCII_ASCII = [
      (u'\u3000', u' '), # space
      (u'\u3001', u','), # comma
      (u'\u300c', u'"'), # single quotes, left
      (u'\u300d', u'"'), # single quotes, right
      (u'\u300e', u'"'), # double quotes, left
      (u'\u300f', u'"'), # double quotes, right
  ]

It then replaces the non-ASCII chars with the ASCII ones.

Original issue reported on code.google.com by jefu...@gmail.com on 27 Feb 2009 at 2:57

Attachments:

GoogleCodeExporter commented 9 years ago
Oops, the patch had a small error in it. Please use this one.

Original comment by jefu...@gmail.com on 27 Feb 2009 at 10:55

Attachments: