Code Monkey home page Code Monkey logo

Comments (8)

SimonSapin avatar SimonSapin commented on July 4, 2024

What kind of encoding do you mean? Percent-encoding? What should the description include?

from rust-url.

teburd avatar teburd commented on July 4, 2024

Maybe something like "URL parsing and encoding" or the "URL library for Rust" like described in the github Readme.

from rust-url.

SimonSapin avatar SimonSapin commented on July 4, 2024

I’m still not sure what "encoding" means to you in this context. Is it that the fields in the Url struct are percent-encoded? Is it the percent_encoding module that you can use on any string, independently of URLs?

from rust-url.

teburd avatar teburd commented on July 4, 2024

https://github.com/servo/rust-url/blob/master/src/lib.rs#L55

There's quite a few serialize_* methods besides that one that work on a Url struct.

https://github.com/servo/rust-url/blob/master/src/form_urlencoded.rs#L93

Serialize url query strings (form encoding).

I actually don't fully understand what you mean by percent encoding. But my impression of this library is that it would be the near equivalent of

http://golang.org/pkg/net/url/

or

http://docs.oracle.com/javase/7/docs/api/java/net/URL.html

Which let you both parse and encode URLs , not just the query string parts but the entire URL. And certainly not just parse them.

from rust-url.

SimonSapin avatar SimonSapin commented on July 4, 2024

Percent-encoding is replacing non-ASCII bytes or bytes that would otherwise have a special meaning with a % percent sign followed by two hexadecimal digits representing the value of that byte: https://url.spec.whatwg.org/#percent-encoded-bytes

Sorry, I still don’t understand what "encode an URL" means to you, and how it’s different from parsing. Could you expand a bit more, without reusing the same words?

from rust-url.

teburd avatar teburd commented on July 4, 2024

This library can not only parse strings (containing urls) in to a data structure but it can also serialize (or encode) that data structure back in to a string. The query parameters included.

I think saying it is a URL parser library makes it harder to find as a general purpose URL manipulation and Rust struct representation library, which it appears to be. I wasn't looking for a URL parsing library, I was looking for a library to create a URL from a bunch of parts of a URL like the golang and java libraries let me do. Those libraries don't call themselves URL parsers, just URL libraries.

from rust-url.

SimonSapin avatar SimonSapin commented on July 4, 2024

Ah! I finally got it, you call encode what I call serialize. Sorry for the confusion :)

How does this look? #122

from rust-url.

teburd avatar teburd commented on July 4, 2024

Perfect!

from rust-url.

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.