﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27125	Can not support django Internationalized domain name in URLValidation	Ramin Farajpour Cami	nobody	"Hi,

i see here [https://github.com/django/django/blob/master/django/core/validators.py#L116 validator.py], there isn't docs aboud [https://en.wikipedia.org/wiki/Internationalized_domain_name IDN] supported django IDN or no, 

there is arabic domains on internet like [http://عربي.امارات عربي.امارات] 

{{{
from django.core.validators import URLValidator
validate = URLValidator()

validate('http://عربی.امارات')
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""C:\Python27\lib\site-packages\django\core\validators.py"", line 114, in __call__
    value = force_text(value)
  File ""C:\Python27\lib\site-packages\django\utils\encoding.py"", line 88, in force_text
    raise DjangoUnicodeDecodeError(s, *e.args)
django.utils.encoding.DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x9f in position 12: invalid start byte. You passed in 'http://\xe3\xa9\xa0?.\x9f\xea\x9f\xa9\x9f\xa2' (<type 'str'>)

}}}

You can use idn2 tool.
{{{
root@ramin ~ > idn2 'عربي.امارات'
xn--ngbrx4e.xn--mgbaam7a8h
root@ramin > nslookup $(idn2 'عربي.امارات')
Server:         127.0.1.1
Address:        127.0.1.1#53

Non-authoritative answer:
Name:   xn--ngbrx4e.xn--mgbaam7a8h
Address: 79.98.120.105

root@ramin > nmap $(idn2 'عربي.امارات') -p80

Starting Nmap 6.40 ( http://nmap.org ) at 2016-08-26 12:09 +07
Nmap scan report for xn--ngbrx4e.xn--mgbaam7a8h (79.98.120.105)
Host is up (0.23s latency).
rDNS record for 79.98.120.105: web-lb0.web.308th.dubai.aeda.net.ae
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 0.88 seconds  
}}}

or use CURL

{{{
$ curl --head xn--ngbrx4e.xn--mgbaam7a8h

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/1.0 200 OK
Date: Fri, 26 Aug 2016 05:09:07 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Content-Type: text/html
Connection: close
}}}
 
please see this answer [http://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php/4694816#4694816 stackoverflow]

Thanks,
Ramin

"	New feature	closed	Core (URLs)	1.10	Normal	invalid			Unreviewed	0	0	0	0	0	0
