Skip to content

Internationalized domain names are not encoded #1

@ljosa

Description

@ljosa

In order to match Django behavior, internationalized domain names should be IDNA encoded. For instance, if a user enters “www.røasenter.no”, the link should go to “www.xn--rasenter-54a.no”. In other words,

urlize('www.røasenter.no')

should return

"<a href="http://www.xn--rasenter-54a.no">www.røasenter.no</a>"

Instead, it returns

"<a href=\"http://www.r%C3%B8asenter.no\">www.røasenter.no</a>",

which also seems to work, but is different from what Django returns.

See the test named IDN in test_urlize.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions