Ask Your Question

unicode issue in tag and url

asked 2011-11-24 21:54:58 -0500

str gravatar image

I have askbot successfully running. Thanks for this beautiful project.

Two unicode issues, while 'ask a question' -

  1. I cant put a unicode word as tag. (Error: use-these-chars-in-tags)

  2. Is it possible I get the unicode title in the url? For example, I put the title as मलेशिया में जलवायु , whereas after posting, I get the url as '/mleshiyaa-men-jlvaayu'.

Any workout much appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2011-11-25 07:49:25 -0500

Evgeny gravatar image

Hello, firstly - it is possible in principle to make urls show unicode characters, but not all browsers support it well - we can make an experimental feature for that.

Regarding unicode in tags - it works, but the test for acceptable tag forbids non-word characters, the error message should really read: "Only word characters, and symbols +-.# are allowed in the tags."

For example, in जलवायु the character that goes just before the last is not accepted. What does it mean not sure whether it is right or not - we will need your help here.

What language is this?

edit flag offensive delete link more


Many Thanks. for the unicode part in url - could you please point me to the code I've to change, unless you dont' come up with the experimental feature shortly. For the tag - my example is with a Hindi word - u mean not all the characters in that word are Unicode?

str gravatar imagestr ( 2011-11-25 07:57:00 -0500 )edit

Then there must be a bug in the python regex module or maybe in the browser (try entering the same chars in a different browser). It seems to be thinking that you have a word break within the sequence of characters. The solutions to these would be: (1) identify and fix the bug in the program that causes the error; (2) in askbot relax the rules on tag validation, maybe per some optional setting.

Evgeny gravatar imageEvgeny ( 2011-11-25 07:58:42 -0500 )edit

thanks again. I'm working with mainly Bengali (that word was Hindi, anyway). Please check with a sample word in Bengali, বাংলাদেশ (this is the name of the country, Bangladesh)

str gravatar imagestr ( 2011-11-25 08:06:07 -0500 )edit

The slugification code is in askbot.utils.slug.slugify. Actually there is an option already that will enable unicode support in the slug portion of the urls, it is not yet in the live settings, but in django's file ALLOW_UNICODE_SLUGS.

Evgeny gravatar imageEvgeny ( 2011-11-25 08:07:53 -0500 )edit

Strange, the last word you entered in the comment does not show well in my Chrome.

Evgeny gravatar imageEvgeny ( 2011-11-25 08:09:15 -0500 )edit

I set ALLOWUNICODESLUGS=True in askbot-devel/askbot/setup-templates/, then run 'python develop', restarted the server. But still url is not in unicode.

str gravatar imagestr ( 2011-11-25 08:25:10 -0500 )edit

Please add that setting to your project, not the setup_templates one.

Evgeny gravatar imageEvgeny ( 2011-11-25 08:27:50 -0500 )edit

About not seeing the unicode word in chrome, I'm not sure if that's an chrome issue (its working in my chrome). I just checked with a freshly installed firefox, it shows the characters properly there, but can't insert as tag still.

str gravatar imagestr ( 2011-11-25 08:28:40 -0500 )edit

Yes, Evgeny!!! The unicode title is showing up in the url as it is - as soon as I changed in project's So many thanks!!

str gravatar imagestr ( 2011-11-25 08:33:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-11-24 21:54:58 -0500

Seen: 216 times

Last updated: Nov 25 '11