Re: Non html safe chars on urls,
On Mon, 2009-08-03 at 12:27 +0300, Mirat Bayrak wrote: > Hi i have an account system that you have to validate your email after > you created an account. My validation url is lik : > www.foo.com/account/confirm/username/keyyy > > But there is a problem, sometimes username contains non html safe > chars for example : âlice, or süleyman cant go that adress... > > So, what should i do? should i restrict usuable characters on > usernames or is there another solution? Django provides some utility functions for creating valid URL's from UTF-8 strings. Have a look at the iri_to_uri() function, documented here: http://docs.djangoproject.com/en/dev/ref/unicode/#uri-and-iri-handling (Yes, that is a little bit hidden. Linking things in from all the useful places is a continual process.) Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Non html safe chars on urls,
On Mon, Aug 3, 2009 at 11:27 AM, Mirat Bayrakwrote: > Hi i have an account system that you have to validate your email after you > created an account. My validation url is lik : > www.foo.com/account/confirm/username/keyyy > > But there is a problem, sometimes username contains non html safe chars for > example : âlice, or süleyman cant go that adress... > > So, what should i do? should i restrict usuable characters on usernames or > is there another solution? > Use user_id instead of username? Encode username with base64? URLs can contain UTF8 characters if properly encoded, so i dont think this is a problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Non html safe chars on urls,
Hi i have an account system that you have to validate your email after you created an account. My validation url is lik : www.foo.com/account/confirm/* username/keyyy* But there is a problem, sometimes username contains non html safe chars for example : *â*lice, or s*ü*leyman cant go that adress... So, what should i do? should i restrict usuable characters on usernames or is there another solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---