I have a small question about whitspace characters and how they are handeled:
They should be encoded in PCT, am I right? How are they treated in the tostring()? Should we translate them or just check that, if given (for example https://%ad) are valid?
The user that wants to parse URLs should percent-encode them (functions that do this are usually called UrlEncode / UriEncode).
However, you have only to follow the grammar.
Therefore, you do not have to encode/decode spaces (or any other pct-encoded symbol for that matter).