In my Python 3 program I've come across weirdly encoded strings such as "abol%C3%A2t" (abolât) and "%C5%93ufs" (œufs). I get them from WiktionaryParser.
I've only found ways to encode it to UTF-8 for quoted-printable strings, which is not the case here. How can I change a string from "%C3%A9vitables" to "évitables"?
In section 126.96.36.199 of the HTML 4.01 specification the steps to encode into x-www-form-urlencoded starts with
Space characters are replaced by `+', and then reserved characters are escaped
I’m trying to understand
I’m asking as part of reading the references in this answer.
Name = Trent, Bolt
I have encoded and assigned '%20' instead of "+" .Now it is Trent%2C%20Bolt . But it is not working.
Flow : (Trent, Bolt) -> (Trent%2C%2BBolt) -> (Replacing "%2B" to "%20") -> (Trent%2C%20Bolt).
May I get some help. Please!
If I encode a string like this:
var escapedString = originalString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)
it doesn't escape the slashes
I've searched and found this Objective C code:
NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes( NULL, (CFStringRef)unencodedString, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#", kCFStringEncodingUTF8 );
Is there an easier way to encode an URL and if not, how do I write this in Swift?
If I do this in .Net Core 3.1:
await new HttpClient().GetAsync("http://test.com/page?parameter=%2D%2E%5F%2E%2D");
then this happens:
GET http://test.com/page?parameter=-._.- HTTP/1.1
but this is what I want:
GET http://test.com/page?parameter=%2D%2E%5F%2E%2D HTTP/1.1
The background is that I get a signed Url from a third party and I need to use the url as it is, non-unescaped. I manage to find the resource with the unescaped url, but the signature check fails on the other end because the url they see in the request is not the url that was signed.
I can paste the url into any browser and get the resource, but the signature check fails when I do it programatically in .Net Core 3.1.
The unescaping is supposed to happen according to documentation on the Uri Class:
Escaped characters (also known as percent-encoded octets) that don't have a reserved purpose are decoded (also known as being unescaped). These unreserved characters include uppercase and lowercase letters (%41-%5A and %61-%7A), decimal digits (%30-%39), hyphen (%2D), period (%2E), underscore (%5F), and tilde (%7E).
I have tried solutions listed in these questions:
GETting a URL with an url-encoded slash. But the
schemeSetting seems not to work for .Net Core 3.1 and and neither does the workaround
How to make System.Uri not to unescape %2f (slash) in path?. Again
schemeSetting seems not to work for .Net Core 3.1, and neither does the workaround
So, does anyone know how I can use the signed url as is, non-unescaped, on .Net Core 3.1?