urldecode

How to URL-encode/decode SELECTED text in Notepad++

[亡魂溺海] 提交于 2020-07-09 02:33:24
问题 There is a question here on stack overflow that answers PART of my question (see link) https://stackoverflow.com/a/17431971/2461910 Unfortunately, this solution is cumbersome, because it always encodes/decodes the ENTIRE current document. My question is: How can I change the JavaScript in that solution to only modify whatever text is SELECTED in the current document? I tried using Editor.currentView.selected , but that throws an error when the script runs. If only I could find a document

PHP处理中文真是累啊

你。 提交于 2020-02-20 19:23:45
折腾了一天的时间,才弄出点眉目来。 做AJAX应用或Flash应用,提交中文内容到后台,涉及到编码解码(encode、decode)及编码格式的转换。 网上的PHP端escape unescape函数建议不要用,它把中英文混合时的英文过滤掉了,我是莫名其妙了N久啊,建议用unicode_urldecode这个。 再就是编码格式的转换,这主要涉及数据的存储和客户端返回,用iconv就搞定,这个函数似乎是从C++中借鉴来的。 function unicode_urldecode($url) { preg_match_all('/%u([[:alnum:]]{4})/', $url, $a); foreach ($a[1] as $uniord) { $dec = hexdec($uniord); $utf = ''; if ($dec < 128) { $utf = chr($dec); } else if ($dec < 2048) { $utf = chr(192 + (($dec - ($dec % 64)) / 64)); $utf .= chr(128 + ($dec % 64)); } else { $utf = chr(224 + (($dec - ($dec % 4096)) / 4096)); $utf .= chr(128 + ((($dec % 4096) - (

Decoding international chars in AppEngine

倾然丶 夕夏残阳落幕 提交于 2020-01-25 04:00:06
问题 I'm making a small project in Google AppEngine but I'm having problems with international chars. My program takes data from the user through the url "page.html?data1&data2..." and stores it for displaying later. But when the user are using some international characters like åäö it gets coded as %F4, %F5 and %F6. I assume it is because only the first 128(?) chars in ASCII table are allowed in http-requests. Is there anyone who has a good solution for this? Any simple way to decode the text?

What does “the value of the cookie is automatically URLencoded when sending the cookie, and automatically decoded when received” mean?

让人想犯罪 __ 提交于 2020-01-22 03:12:25
问题 While learning the concept of Cookies in PHP, I come across the following statement from w3schools PHP Tutorial: The value of the cookie is automatically URLencoded when sending the cookie, and automatically decoded when received (to prevent URLencoding, use setrawcookie() instead) I did not get the meaning of this statement. I have following doubts regarding the above statement : From where the cookie is being sent to whom and at where the cookie is being received from whom? What actually

Re-encode url from utf-8 encoded to iso-8859-1 encoded

大憨熊 提交于 2020-01-02 06:01:11
问题 I have file:// links with non-english characters which are UrlEncoded in UTF-8. For these links to work in a browser I have to re-encode them. file://development/H%C3%A5ndplukket.doc becomes file://development/H%e5ndplukket.doc I have the following code which works: public string ReEncodeUrl(string url) { Encoding enc = Encoding.GetEncoding("iso-8859-1"); string[] parts = url.Split('/'); for (int i = 1; i < parts.Length; i++) { parts[i] = HttpUtility.UrlDecode(parts[i]); // Decode to string

Re-encode url from utf-8 encoded to iso-8859-1 encoded

一世执手 提交于 2020-01-02 06:00:04
问题 I have file:// links with non-english characters which are UrlEncoded in UTF-8. For these links to work in a browser I have to re-encode them. file://development/H%C3%A5ndplukket.doc becomes file://development/H%e5ndplukket.doc I have the following code which works: public string ReEncodeUrl(string url) { Encoding enc = Encoding.GetEncoding("iso-8859-1"); string[] parts = url.Split('/'); for (int i = 1; i < parts.Length; i++) { parts[i] = HttpUtility.UrlDecode(parts[i]); // Decode to string

How to “URL decode” a string in Emacs Lisp?

落爺英雄遲暮 提交于 2020-01-01 07:30:14
问题 I've got a string like "foo%20bar" and I want "foo bar" out of it. I know there's got to be a built-in function to decode a URL-encoded string (query string) in Emacs Lisp, but for the life of me I can't find it today, either in my lisp/ folder or with google. Anybody remember what it's called? 回答1: org-link-unescape does the job for very simple cases ... w3m-url-decode-string is better, but it isn't built in and the version I have locally isn't working with Emacs 23. 回答2: url-unhex-string

How to know if a URL is decoded/encoded?

梦想与她 提交于 2020-01-01 01:15:17
问题 I am using Javascript method decodeURIComponent to decode an encoded URL. Now I am having an issue, that sometimes the URL is get encoded twice during redirection between servers, sometimes it is encoded only once. I want to check that if the URL is still encoded after calling the method decodeURIComponent . How can I do that? Any pointer would be very helpful to me. Update - 1 If I recursively call a method and check that if the given URL still contains "%", if it contains "%" then decode it

%20 is added instead of spaces

做~自己de王妃 提交于 2019-12-23 15:33:32
问题 I guess this is small issue but yet i had to ask here since i am running short in my project. When I pass string to the function in another controller, it changes spaces into %20 sign. I guess the controller thinks the string passed as url and encodes it. But I don't know exactly how to remove it or if possible do not let it to change spaces into %20. Here is the code which i use; $message="The user name you provided is already in our database"; redirect('admin/add_user/'.$message); Here is

Does Windows have any built-in utility to encode/decode URL?

ぐ巨炮叔叔 提交于 2019-12-23 10:07:31
问题 The certutil utiliiy in Windows can be used to perform Base64 encoding and deocding. Is there any built-in utility for URL encoding and decoding? There are many free tools available on web. But I am specifically looking for Windows built-in utility or if not simple script that can run on Windows. Thanks! 回答1: Base64 VBA Base64 encoding and decoding can be done with VBA. You can copy/paste this code and put it in Excel VBA, for example, and then use it's methods to encode and decode Base64.