percent-encoding

Avoid percent-encoding href attributes when using PHP's DOMDocument

走远了吗. 提交于 2021-02-18 11:11:29
问题 The best answers I was able to find for this issue are using XSLT, but I'm just not sure how to apply those answers to my problem. Basically, DOMDocument is doing a fine job of escaping URLs (in href attributes) that are passed in, but I'm actually using it to build a Twig/Django style template, and I'd rather it leave them alone. Here's a specific example, illustrating the "problem": <?php $doc = new DOMDocument(); $doc->loadHTML('<html><body>Test<br><a href="{{variable}}"></a></body></html>

Use character # in URL inside file name

陌路散爱 提交于 2021-02-04 17:28:09
问题 I need to put a link with this href="file://attachments/aaaa_#_aaaa.msg" Obviously in that way is not working because the hash character # is used for anchors. So I try to change this to: href="file://attachments/aaaa_%23_aaaa.msg" but when I open the url in the IE, the browser is trying to open this: href="file://attachments/aaaa_%2523_aaaa.msg" IE is encoding the % character to %25 How can I put the file name in the URL to encode and read the hash character # in all the browsers to download

Use character # in URL inside file name

爱⌒轻易说出口 提交于 2021-02-04 17:28:05
问题 I need to put a link with this href="file://attachments/aaaa_#_aaaa.msg" Obviously in that way is not working because the hash character # is used for anchors. So I try to change this to: href="file://attachments/aaaa_%23_aaaa.msg" but when I open the url in the IE, the browser is trying to open this: href="file://attachments/aaaa_%2523_aaaa.msg" IE is encoding the % character to %25 How can I put the file name in the URL to encode and read the hash character # in all the browsers to download

How do I convert HTML percent-encoding to Unicode, with XSLT?

吃可爱长大的小学妹 提交于 2021-02-04 14:07:53
问题 There are tons of entries and answers online about this, but they're all going the opposite direction of what I need. From my iTunes XML, I have thousands of percent-encoded entries, in multiple languages, that I'm trying to convert, with an XSLT stylesheet, to Unicode text. Is there any function or process that I'm missing, other than tracking down every single character and doing a replace? Here is a small sample of some examples of the variety that I'm working with, the first line is the

How do I convert HTML percent-encoding to Unicode, with XSLT?

隐身守侯 提交于 2021-02-04 14:06:27
问题 There are tons of entries and answers online about this, but they're all going the opposite direction of what I need. From my iTunes XML, I have thousands of percent-encoded entries, in multiple languages, that I'm trying to convert, with an XSLT stylesheet, to Unicode text. Is there any function or process that I'm missing, other than tracking down every single character and doing a replace? Here is a small sample of some examples of the variety that I'm working with, the first line is the

mod_rewrite rule to enforce canonical percent-encoding

亡梦爱人 提交于 2020-01-01 14:23:06
问题 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

Discrepancies of Percent Encoding for URLs

♀尐吖头ヾ 提交于 2019-12-23 03:57:20
问题 After viewing this previous SO question regarding percent encoding, I'm curious as to which styles of encodings are correct - the Wikipedia article on percent encoding alludes to using + instead of %20 for spaces, while still having an application/x-www-urlencoded content type. This leads me to think the + vs. %20 behavior depends on which part of the URL is being encoded. What differences are preferred for path segments vs. query strings? Details and references for this specification would

How to prevent Google Chrome and IE substituting '|' in URL with %7C

可紊 提交于 2019-12-13 23:03:34
问题 We have adapted an old website to use semantic URLs and - for a number of reasons - are unable to use a / as a seperator. Instead, we are using | as our seperator. For example: www.example.com/page|sub-page1|sub-sub-page2 Everything is working fine with only one small problem. Google Chrome and IE are displaying the URL as: www.example.com/page%7Csub-page1%7Csub-sub-page2 We are using | to encode our | seperator but Chrome and IE are still substituting with %7C . Firefox and Safari display

Trying to decode % character in a parameter value JMeter fails with IllegalArgumentException: URLDecoder: Illegal hex characters in escape(%) pattern

我的梦境 提交于 2019-12-11 07:54:54
问题 Using Apache JMeter 2.7, the message body (JSON) for my POST request contains a password field which is in the form asdf%xy3dsfsfsf . JMeter is trying to interpret %xy as percent encoded character and throwing this exception. Uncaught Exception java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape(%) pattern - For input string: "xy". See log file for details. I cannot escape the character using backslash asdf\%xy3dsfsfsf since it would get to the webservice as the

URL percent encoding is not working

末鹿安然 提交于 2019-12-11 07:07:50
问题 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