percent-encoding

Why is ë percent encoded to %EB but also to %C3%AB?

空扰寡人 提交于 2019-12-10 20:41:04
问题 When I enter ë into a form on my web application, this is percent encoded by Google Chrome to %C3%AB. When I use PHP's urlencode('ë'); This is encoded into %EB. Why are the encodings different? How can I encode with the same encoding as Google Chrome with PHP 4? 回答1: %EB is the ISO-8859-1 form (a single character). %C3%AB is the UTF-8 form ( e + ¨ ). It should work out of the box (if you use a newer version of PHP and UTF-8 for your files). 来源: https://stackoverflow.com/questions/12860837/why

Is '|' a recommended separator for semantic URLs?

*爱你&永不变心* 提交于 2019-12-10 09:16:26
问题 After researching Google and SO, there seems to be conflicting opinions on this. We have run-in to a problem with Google Chrome substituting | separator as %7C , whereas Firefox and Safari do not. Here's an example: http://www.example.com/page1|sub-page2|sub-page-3 Are there any strict rules to follow when choosing a separator character for semantic URLs and are there any strong arguments against (or workarounds when) using | ? 回答1: | is not a valid character in a URL. Modern browsers will

mod_rewrite rule to enforce canonical percent-encoding

寵の児 提交于 2019-12-04 14:29:50
We have a PHP app with a dynamic URL scheme which requires characters to be percent-encoded, even " unreserved characters " like parentheses or aphostrophes which aren't actually required to be encoded. URLs which the app deems to be encoded the "wrong" way are canonicalized and then redirected to the "right" encoding. But Google and other user agents will canonicalize percent-encoding/decoding differently, meaning when Googlebot requests the page it will ask for the "wrong" URL, and when it gets back a redirect to the "right" URL, Googlebot will refuse to follow the redirect and will refuse

URL percent encoding is not working

好久不见. 提交于 2019-12-04 05:22:15
问题 I'm trying to do a somewhat simple thing with no luck - I want to display Hebrew/Arabic characters in my URL. For example: I want the URL to display a file named: aאm.php So I've percent encoded the middle UTF8 characters and the result is: a%D7%90m.php . I've uploaded a%D7%90m.php to my server (Apache) and tried to request the pages www.example.com/a%D7%90m.php & www.example.com/aאm.php but my server responded: The requested URL /a%D7%90m.php was not found on this server. So I tried to

Percent encoding javascript

烈酒焚心 提交于 2019-12-03 09:27:21
问题 Is there a javascript function that takes a string and converts it into another string that is percent-encoded? That way something like "This Guy" turns into "This%20Guy". Thanks 回答1: Try encodeURIComponent() or escape() 回答2: encodeURI , encodeURIComponent or escape will work the same way for your string, but they differ in details. encodeURI is just for escaping URLs encodeURIComponent also escapes = and & escape works differently with non-ASCII unicode symbols encodeURI("Ω") ===

Percent encoding javascript

爷,独闯天下 提交于 2019-12-03 00:01:49
Is there a javascript function that takes a string and converts it into another string that is percent-encoded? That way something like "This Guy" turns into "This%20Guy". Thanks Try encodeURIComponent() or escape() encodeURI , encodeURIComponent or escape will work the same way for your string, but they differ in details. encodeURI is just for escaping URLs encodeURIComponent also escapes = and & escape works differently with non-ASCII unicode symbols encodeURI("Ω") === encodeURIComponent("Ω") === "%CE%A9" escape("Ω") === "%u03A9" if you need to send a string as part of request, use

URL percent encoding is not working

半世苍凉 提交于 2019-12-02 07:11:21
I'm trying to do a somewhat simple thing with no luck - I want to display Hebrew/Arabic characters in my URL. For example: I want the URL to display a file named: aאm.php So I've percent encoded the middle UTF8 characters and the result is: a%D7%90m.php . I've uploaded a%D7%90m.php to my server (Apache) and tried to request the pages www.example.com/a%D7%90m.php & www.example.com/aאm.php but my server responded: The requested URL /a%D7%90m.php was not found on this server. So I tried to upload aאm.php (without the percent encoding) instead, but again no luck when browsing www.example.com/a%D7

How to decode a reserved escape character in a request URI on a web server?

这一生的挚爱 提交于 2019-12-01 18:22:15
It is pretty clear that a web server has to decode any escaped unreserved character (such as alphanums, etc.) to do the URI comparison. For example, http://www.example.com/~user/index.htm shall be identical to http://www.example.com/%7Euser/index.htm . My question is, what are we gonna do with the escaped reserved characters? An example would be %2F , or / . If there is an %2F in the request URI, should the parser of web server replace it with a / ? In the above example, it would mean that http://www.example.com/~user%2Findex.htm would be the same as http://www.example.com/~user/index.htm ?

How to decode a reserved escape character in a request URI on a web server?

亡梦爱人 提交于 2019-12-01 17:45:01
问题 It is pretty clear that a web server has to decode any escaped unreserved character (such as alphanums, etc.) to do the URI comparison. For example, http://www.example.com/~user/index.htm shall be identical to http://www.example.com/%7Euser/index.htm . My question is, what are we gonna do with the escaped reserved characters? An example would be %2F , or / . If there is an %2F in the request URI, should the parser of web server replace it with a / ? In the above example, it would mean that

Uri.EscapeDataString weirdness

半世苍凉 提交于 2019-11-30 21:18:57
Why does EscapeDataString behave differently between .NET 4 and 4.5? The outputs are Uri.EscapeDataString("-_.!~*'()") => "-_.!~*'()" Uri.EscapeDataString("-_.!~*'()") => "-_.%21~%2A%27%28%29" The documentation By default, the EscapeDataString method converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the EscapeDataString method converts all characters, except for RFC 3986 unreserved characters, to their hexadecimal representation. All