unicode urls (not domains)

1 view
Skip to first unread message

BjornSteinarF...@gmail.com

unread,
Nov 8, 2006, 4:40:08 PM11/8/06
to Django users
Does anyone know how much trouble I'll get myself into if I try to use
Norwegian characters in urlpatterns, e.g. I'd like to map the url
foo/blåbærsyltetøy.

I've noticed that if you type that into your browser's address bar each
browser does its own thing, Firefox url-encodes it using a iso-8859-1
(latin-1) encoding of the string, IE url-encodes using utf-8, and I'm
not quite sure what Opera does.

I managed to get all of them to display using

(u'^foo/blåbærsyltetøy/$'.encode('utf-8'), 'myview'),
(u'^foo/blåbærsyltetøy/$'.encode('iso-8859-1'), 'myview'),
(u'^foo/blåbærsyltetøy/$', 'myview'),

I seem to recall that I couldn't get Opera to work without the last
one, but I could be remembering this incorrectly...

Has anyone done anything like this?

-- bjorn
~~~~~~~~~~~~~~~~~
http://blog.tkbe.org
~~~~~~~~~~~~~~~~~

Reply all
Reply to author
Forward
0 new messages