urlencode

How to encode the plus (+) symbol in URL

对着背影说爱祢 提交于 2020-01-19 03:09:19
问题 The URL link below will open a new Google mail window. The problem I have is that Google replaces all the plus (+) sign in the email body with blank space. It looks like it only happens with the + sign. Any suggestions on how to remedy this? ( I am working the ASP.NET web page) https://mail.google.com/mail?view=cm&tf=0&to=someemail@somedomain.com&su=some subject&body=Hi there+Hello there (In the body email, "Hi there+Hello there" will show up as "Hi there Hello there") 回答1: The + character

templateUrl fails on a Component decorator in angular 2 - is prefixing extra double quote '%E2%80%9C' to url

核能气质少年 提交于 2020-01-17 06:51:39
问题 I have a LoginComponent class that has a Component decorator in Angular 2 (RC1). import {Component} from "@angular/core"; @Component({ selector: "login", templateUrl: "login-view.html" // Right here }) When the LoginComponent is loaded by the browser, it will fetch the template at the given template Url as defined above. What I am seeing is that the template GET is returning a 404. Upon closer inspection, I am seeing that the request url is: http://localhost:3000/%E2%80%9C/login-view.html I

Apache: mod_rewrite: Spcaes & Special Characters in URL not working

假装没事ソ 提交于 2020-01-16 07:10:40
问题 i am using APACHE:mod_rewrite to define a set of rules for rewritting URLS i want this link to be displayed as /myDIR/walls.php?f=All&of=0&s=Newest -> All.html so i am using the following rule text from (.htaccess) RewriteEngine on RewriteBase /myDIR/ RewriteRule ^All\.html$ papers.php?f=All&of=0&s=Newest now these variables that are being passed as f=All of=0 s=Newest these are being used in query, OBVIOUSLY, and one of these variables, i.e f sometimes has values with spaces and special

Parentheses passed in url break codigniter query

陌路散爱 提交于 2020-01-16 03:56:08
问题 I have a string being passed via an URL to a Codeigniter driven site. The string is urlencoded before being passed, then urldecoded by the controller before being passed to a function in the model that searches for the string in a database table. I've read several other posts/articles on this, but none offer a viable (for me) solution to the issue. Here are some of the things I have read: URL having parentheses not working in codeigniter with datamapper ORM Parenthesis issue in codeigniter

微信公众号 — 获取用户信息

China☆狼群 提交于 2020-01-15 00:40:31
微信公众号测试地址: https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index 微信公众号官方文档: https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html UrlEncode编码: http://tool.chinaz.com/tools/urlencode.aspx 需要注意的点: 1 .JS接口安全域名填写,需要与加密的URL相同,如: www.baidu.com 2 .授权回调页面域名填写,公众号只能填写一个回调地址,如果需要根据不同场景跳转多个地址,可以尝试使用ng进行转发,从而实现业务要求。 3 .获取用户信息,获取用户信息有两种方式, 3.1 关注公众号,这种方式可以使用基础的accessToken,还可以通过腾讯提供的方法,获取关注公众号的所有用户信息(每次最多查询10000条)。具体实现方法参考微信官方接口文档。 3.2 用户授权,这种方式需要在页面跳转的时候,用户手动授权,从而获取用户信息。这种方式每个用户都有一个对应的accessToken。 获取用户信息的步骤: a 、跳转活动页面如: https://open.weixin.qq.com

urlencode、urldecode、rawurlencode、rawurldecod

拈花ヽ惹草 提交于 2020-01-13 12:31:03
urlencode — 编码 URL 字符串 说明:urlencode ( string $str ) : string 此函数便于将字符串编码并将其用于 URL 的请求部分,同时它还便于将变量传递给下一页。 返回字符串,此字符串中除了 -_. 之外的所有非字母数字字符都将被替换成百分号(%)后跟两位十六进制数,空格则编码为加号(+)。此编码与 WWW 表单 POST 数据的编码方式是一样的,同时与 application/x-www-form-urlencoded 的媒体类型编码方式一样。 urldecode — 解码已编码的 URL 字符串 说明:urldecode ( string $str ) : string 解码给出的已编码字符串中的任何 %##。 加号('+')被解码成一个空格字符。 返回解码后的字符串。 实例: rawurlencode: 返回字符串,此字符串中除了 -_. 之外的所有非字母数字字符都将被替换成百分号(%)后跟两位十六进制数。这是在 » RFC 3986 中描述的编码,是为了保护原义字符以免其被解释为特殊的 URL 定界符,同时保护 URL 格式以免其被传输媒体(像一些邮件系统)使用字符转换时弄乱。(与urlencode的区别其实也就是对空格的处理) rawurldecod: 来源: https://www.cnblogs.com/jongty/p

Sending arabic characters in URL

前提是你 提交于 2020-01-12 09:56:09
问题 i have these arabic sentence: نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي It must be sent in the url. I tried this approach: $url = 'http://example.com/?q='.urlencode('نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي'); The result of that encoding is: %D9%86%D8%A7%D9%8A%D8%AA%D9%8A%D8%AF+%D8%A3%D9%85%D8%A7%D9%85%D9%87+%D8%B9%D8%B4%D8%B1%D8%A9+%D8%A3%D9%8A%D8%A7%D9%85+%D9%81%D9%82%D8%B7+%D9%84%D9%83%D9%8A+%D9%8A%D9%82%D8%B1%D8%B1+%D9%85%D8%B3%D8%AA%D9%82%D8%A8%D9

Sending arabic characters in URL

末鹿安然 提交于 2020-01-12 09:55:29
问题 i have these arabic sentence: نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي It must be sent in the url. I tried this approach: $url = 'http://example.com/?q='.urlencode('نايتيد أمامه عشرة أيام فقط لكي يقرر مستقبل برباتوف في النادي'); The result of that encoding is: %D9%86%D8%A7%D9%8A%D8%AA%D9%8A%D8%AF+%D8%A3%D9%85%D8%A7%D9%85%D9%87+%D8%B9%D8%B4%D8%B1%D8%A9+%D8%A3%D9%8A%D8%A7%D9%85+%D9%81%D9%82%D8%B7+%D9%84%D9%83%D9%8A+%D9%8A%D9%82%D8%B1%D8%B1+%D9%85%D8%B3%D8%AA%D9%82%D8%A8%D9

Why I can't use urlencode to encode json format data?

冷暖自知 提交于 2020-01-12 03:29:30
问题 I have a problem about urlencode in python 2.7: >>> import urllib >>> import json >>> urllib.urlencode(json.dumps({'title':"hello world!",'anonymous':False,'needautocategory':True})) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/urllib.py", line 1280, in urlencode raise TypeError TypeError: not a valid non-string sequence or mapping object 回答1: Because urllib.urlencode "converts a mapping object or a sequence of two-element tuples to a

PHP: convert spaces in string into %20?

我们两清 提交于 2020-01-11 15:17:11
问题 How can I convert spaces in string into %20 ? Here is my attempt: $str = "What happens here?"; echo urlencode($str); The output is "What+happens+here%3F" , so the spaces are not represented as %20 . What am I doing wrong? 回答1: Use the rawurlencode function instead. 回答2: The plus sign is the historic encoding for a space character in URL parameters, as documented in the help for the urlencode() function. That same page contains the answer you need - use rawurlencode() instead to get RFC 3986