gmaps-api-net
gmaps-api-net copied to clipboard
ToUri encodes | character as %7C
Created this issue to get feedback from anybody
The types StaticMapRequest.ToUri()
method can return a pipe character '|' which is encoded as %7C on a url, but this isn't exactly correct behavior. The root of the problem is utilizing the core System.Uri class which doesn't get the reserved character set right, according to the RFC 3986 which specifically defines the list of reserved characters, and pipe isn't one of them.
Unfortunately, System.Uri.PathAndQuery will return pipe '|' encoded but ToString() returns it unencoded...
This affects the tests, specifically StaticMapRequestTests.cs#L186 in Points_Two() test method.
Is there any proper RFC 3986 url encoders out there?
When looking on nuget.org, search reveals several "proper" RFC 3986 implementations...
@richardthombs or perhaps https://github.com/balazsbotond/FluentUriBuilder instead of the internal QueryStringBuilder and do any
I don't get it - that test is passing and the expected result contains a "|" character, which is what we want, right?