Git Product home page Git Product logo

Comments (5)

rthalley avatar rthalley commented on August 27, 2024

On Nov 29, 2013, at 6:33, bastiak [email protected] wrote:

--> 348 s = u'.'.join([encodings.idna.ToUnicode(_escapify(x)) for x in l])

I think we need to call something like _escapify after calling encodings.idna.ToUnicode(), but I'm not quite sure what that something is. Clearly "." (and perhaps unicode equivalents to ".") need to be escaped, and escaping space seems sensible, but on the other hand just calling _escapify() is bad because it ends up escaping unicode code points > 127, which seems bad.

I don't know enough about Unicode to know if other whitespace-like things need escaping, if there are any.

I will ponder this further, but anyone who knows Unicode well is encouraged to help :)

/Bob

from dnspython.

 avatar commented on August 27, 2024

Sorry for late answer, I was busy.

In my opinion, in encodings.idna.ToUnicode(value) value should be "de-escapified" string.
Also in encodings.idna.ToASCII(value2) value2 should be pure unicode without escaping.
Python lib handles special cases and will throw an error if it happens.

I'm not sure, but in my opinion the dns.name.to_unicode() method should provide only human readable form of the domain name without any escaping.

from dnspython.

 avatar commented on August 27, 2024

Hi,
do you accept my proposal?

dns.name.from_unicode() should remove any escaping and make a pure unicode string per label, then encode labels with encodings.idna.ToASCII() (labels are stored in punycoded notation without escaping)

dns.name.Name.to_unicode() should convert labels with encodings.idna.ToUnicode() and then escape characters per label

dns.name.Name.to_text() should only escape some required characters per label

I haven't inspected to_wire() and from_wire() yet.

I would like to make a patch.
Bastiak

from dnspython.

rthalley avatar rthalley commented on August 27, 2024

On Mar 28, 2014, at 6:44, bastiak [email protected] wrote:

Hi,
do you accept my proposal?

dns.name.from_unicode() should remove any escaping and make a pure unicode string per label, then encode labels with encodings.idna.ToASCII() (labels are stored in punycoded notation without escaping)

Yes
dns.name.Name.to_unicode() should convert labels with encodings.idna.ToUnicode() and then escape characters per label

This is probably the right thing, but the escaping is different. Probably only the "special characters" in _escaped should be escaped, and perhaps values < 0x20, but values >= 0x80 need to be left alone.
dns.name.Name.to_text() should only escape some required characters per label

dns.name.Name.to_text() should not be changed at all.

I haven't inspected to_wire() and from_wire() yet.

These should not be changed either.

/Bob

from dnspython.

underrun avatar underrun commented on August 27, 2024

but spaces are not allowed in domain names ...

from dnspython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.