On Apr 17, 2011, at 8:51 AM, LightOfMooN wrote: > > request.env.http_host >>> 'xn--h1acfjl4f.xn--p1ai' > So, domain not in utf-8 > How to route it?
That's Punycode, which is how non-ASCII domain names are encoded in ASCII (DNS, for example, operates on the Punycode version of the domain name). Punycode can be converted to Unicode for display purposes, but for routing it's probably best to leave it Punycoded. > > On 17 апр, 21:47, LightOfMooN <[email protected]> wrote: >> It's s strange >> There is 2 rules >> >> 1) >> (r'.*://\xd1\x80\xd0\xb8\xd0\xbb\xd1\x8d\xd0\xb9\xd0\xbd\. >> \xd1\x80\xd1\x84:.* /?', r'/myapp/default/index'), >> >> 2) >> (r'/\xd1\x80\xd0\xb8\xd0\xbb\xd1\x8d\xd0\xb9\xd0\xbd\. >> \xd1\x80\xd1\x84', r'/myapp/default/index'), >> >> 2nd works fine, but not 1st. I can't understand, why.

