Comments (8)
What kind of encoding do you mean? Percent-encoding? What should the description include?
from rust-url.
Maybe something like "URL parsing and encoding" or the "URL library for Rust" like described in the github Readme.
from rust-url.
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.
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.
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.
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.
Ah! I finally got it, you call encode what I call serialize. Sorry for the confusion :)
How does this look? #122
from rust-url.
Perfect!
from rust-url.
Related Issues (20)
- Url::parse regression HOT 1
- Unable to encode + decode URL HOT 2
- Please could you export `SchemeType` or add `is_special()` method to `Url` HOT 1
- Add `ParseError.description() -> &'static str` method like already implemented on `SyntaxViolation` HOT 1
- non-special domain is never an `Ipv4` HOT 2
- DB_URL Password complexity is not supported. For example, the password is QAZwsx123@# HOT 2
- Question: How to convert `Host`/`Origin` to `URL`? HOT 4
- Bug: parser should not add trailing slash unconditionally HOT 9
- Ensure URL roundtrips for opaque paths
- set scheme with non-tab/newline C0 controls should result in no-op
- Origin port as an `Option<u16>`
- percent ("%) character must be percent-encoded as "%25" HOT 1
- Optional API to convert to http::Uri HOT 3
- Wrongly resolves ip to domain. HOT 2
- feature request: more complicated percent-encoding rules HOT 2
- feature: expose pathname publicly HOT 3
- Please add an option to not remove wellknown default ports from URL HOT 1
- Feature Proposal: Builder for Constructing New URL Instances from Parts HOT 2
- The program crashed after using the "join" function.
- Program Crash in fuzzing (assert failed in parse_path)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-url.