url-encoding

Google App Script make get request to another script with parameters

雨燕双飞 提交于 2020-01-06 18:11:51
问题 I have two google scripts: 1) Script A with url say sa/exec which accepts parameters a,b,c 2) Script B with url say sb/exec I have to call doGet(e) of script A from script B. Manually I can do it by typing in browser like sa/exec?a=vala&b=valb&c=valc. And in google script, I can do it like this: var params={ 'method':'get', 'payload':'a=vala&b=valb&c=valc' }; JSON.stringify(UrlFetchApp.fetch(url, params)); But its a very error prone way as we have to escape the special characters manually and

How to (url-)encode filenames containing special UTF-8 or CP1252 characters

安稳与你 提交于 2020-01-06 08:27:54
问题 I have a Server, which hosts many files (e.g. also files, where the filenames contain special chars like "Ü" and "թ") now I am facing a big problem, because I can't create the correct URLs, because I have to encode the special chars in a form the browser understands (e.g. %XX): www..../.../SPRÜCHE.txt --> needs to encode to " SPR%DCCHE.txt " to be found (otherwise 404) www..../.../SPRCHEթ.txt --> needs to encode to " SPRCHE%D5%A9.txt " to be found (otherwise 404) As you see, the first one

MediaWiki API section names encoding

好久不见. 提交于 2020-01-02 19:25:11
问题 For [[Test#?]] , I get " Test#.3F " from action=parse bit of MediaWiki API. What is this encoding and how do I bring it to human readable format using Perl's CPAN? URI::Encode works for the percent decoding, but not the section names one. 回答1: It is UTF-8 percent-encoding, but with . instead of % , and spaces replaced with underscores; additionally, multiple consecutive whitespaces are collapsed, and : is preserved (not encoded into .3A ). The exact code which handles it is Parser:

How can I disable URL-encoding of cookies in Rails

久未见 提交于 2020-01-02 18:09:12
问题 I have a Rails application that has to co-exist with a very old legacy application. The legacy application looks for a cookie that has a value containing a specific string of characters. Unfortunately, the characters in the legacy cookie often contain slashes. The problem I have is that when the Rails application writes the cookie it first does URL-encoding which causes the legacy app to break because the cookie values is incorrect. I had this working in Rails 1.13.5 by editing the file

Why does PHP built-in web server not serve file called é.txt (on Windows)

删除回忆录丶 提交于 2020-01-02 16:29:39
问题 I'm on Windows 7 If I have a directory containing my file é.txt and I start the built-in web server in that directory php -S localhost:8000 then, using my web browser, I request the URL http://localhost:8000/é.txt the web server responds Not Found The requested resource /%C3%A9.txt was not found on this server. 回答1: PHP's Windows filesystem support is broken - it does not properly translate to the native encoding. See How do I use filesystem functions in PHP, using UTF-8 strings? 来源: https:/

Why does PHP built-in web server not serve file called é.txt (on Windows)

半世苍凉 提交于 2020-01-02 16:29:39
问题 I'm on Windows 7 If I have a directory containing my file é.txt and I start the built-in web server in that directory php -S localhost:8000 then, using my web browser, I request the URL http://localhost:8000/é.txt the web server responds Not Found The requested resource /%C3%A9.txt was not found on this server. 回答1: PHP's Windows filesystem support is broken - it does not properly translate to the native encoding. See How do I use filesystem functions in PHP, using UTF-8 strings? 来源: https:/

Why do I have to URI.encode even safe characters for Net::HTTP requests?

北城以北 提交于 2020-01-02 03:50:24
问题 I was trying to send a GET request to Twitter (user ID replaced for privacy reasons) using Net::HTTP: url = URI.parse("http://api.twitter.com/1/friends/ids.json?user_id=12345") resp = Net::HTTP.get_response(url) this throws an exception in Net::HTTP: NoMethodError: undefined method empty?' for #<URI::HTTP:0x59f5c04> from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1470:in initialize' just by coincidence, I stumbled upon a similar code snippet, which

Hotmail messing with encoded URL parameters

隐身守侯 提交于 2020-01-02 02:18:07
问题 We have a system that sends out regular emails with links in, many of which contain URL encoded parameters such as this: href="http://www.mydomain.com/login.aspx?returnurl=http%3A%2F%2Fwww.mydomain.com%2Fview.aspx%3Fid%3D1234%26alert%3Dtrue" You can see that the "returnurl" parameter is encoded. However, it seems that a large number of our users (seemingly hotmail) are receiving the emails with this paramater partly decoded such as: href="http://www.mydomain.com/login.aspx?returnurl=http:/

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

ASP.NET: Get *real* raw URL

给你一囗甜甜゛ 提交于 2020-01-01 09:33:09
问题 In ASP.NET, is there any way to get the real raw URL? For example, if a user browse to "http://example.com/mypage.aspx/%2F", I would like to be able to get "http://example.com/mypage.aspx/%2F" rather than "http://example.com/mypage.aspx//". I would of course like a clean way to do it, but I can live with a hacky approach using reflection or accessing obscure properties. At the moment, I try to use the uri in the Authorization-header (which works), but I cannot rely on that always being there.