url-encoding

.NET MVC Routing w/ Url Encoding Problems

放肆的年华 提交于 2019-12-04 03:27:37
I have the following routing code: routes.MapRoute( "email-validated/{sessionId}", "email-validated/{sessionId}", new { controller = "User", action = "EmailValidated", sessionId = UrlParameter.Optional } ); When I hit the route w/ something that is url encoded it won't match the route for %2f, %2b and some other escaped characters. It also won't match for non url encoded (things w/ + etc) For instance This works: email-validated/XQiKC6KMM%2cmko4nOvzGRwPu9oaZFoCtXsFFJg3ZTf9S5rsBbLGjnz3FN3SJ0apEZcqK1PIcCY28mRMykB39XnFLKaL7390CDfLZiV77cso This doesn't work ( containts %2f etc): email-validated

Indy TIdHTTP URI with login/password not working

让人想犯罪 __ 提交于 2019-12-03 22:28:04
I'm writing an HTTP API wrapper to integrate with particular IP Cameras . Part of the process requires login credentials in the URI, for example: http://user:pass_with_#_sign@address:port/somespecificpath/ I'm using Indy's TIdHTTP.Get to send the request to the device. However, the password consists of a '#' character. If this URI is placed in any browser with the plain password, the # character throws it off. Therefore, I need to encode the password's # to %23 ... http://user:pass_with_%23_sign@address:port/somespecificpath/ When I paste this URI into any browser, it successfully logs in and

NSCharacterSet URLHostAllowedCharacterSet doesn't replace '+' sign?

风流意气都作罢 提交于 2019-12-03 11:15:57
I'm struggling to transmit long encrypted strings over the network and get them to come out correctly on the server. For example, I have this encrypted string on the client: wcWSERZCh8Xm1hpbNo1kSD1LvFmpuUr4wmq9hQUWeK0vYcLeFPGwFR/sBTES1A4rPV6eyp9nzEEU9uKkiFSTdP+SPOSqUf6evjf3WRHrXMRe81lIrHuRyk0iRwoNe5uIk+VlpR41kETmznXa4+gELmf53r7oayRkkffnIPDmpO+WbgE0VL3PQeOsXB01tWJyDiBIsz5WJiiEIm3ZoJW/sw== As you can see, it has a few characters that will not transmit over the network without some URL encoding ( + and / , most notably). I'm not entirely sure if there could be other characters that could arise in

What is the encoding of Chinese characters on Wikipedia?

安稳与你 提交于 2019-12-03 09:44:16
I was looking at the encoding of Chinese characters on Wikipedia and I'm having trouble figuring out what they are using. For instance "的" is encoded as "%E7%9A%84" ( see here ). That's three bytes, however none of the encodings described on this page uses three bytes to represent Chinese characters. UTF-8 for instance uses 2 bytes. I'm basically trying to match these three bytes to an actual character. Any suggestion on what encoding it could be? >>> c='\xe7\x9a\x84'.decode('utf8') >>> c u'\u7684' >>> print c 的 though Unicode encodes it in 16 bits, utf8 breaks it down to 3 bytes. The header

Copying a UTF-8 URL from browser's address bar, gives only the ugly encoded one

北城余情 提交于 2019-12-03 01:09:54
问题 When I copy a UTF-8 URL from the browser's address bar (almost any browser on any os), then try to paste it in another text field (to post it on facebook or twitter for example), it gives only the decoded URL, which makes it ugly. For example, in the address bar, the URL appears like this one: https://www.chaino.com/وذكر But when trying to copy and paste it in any other place, it gives the following ugly url: https://www.chaino.com/%D9%88%D8%B0%D9%83%D8%B1 & if I wanted to get the original

Copying a UTF-8 URL from browser's address bar, gives only the ugly encoded one

瘦欲@ 提交于 2019-12-02 14:50:50
When I copy a UTF-8 URL from the browser's address bar (almost any browser on any os), then try to paste it in another text field (to post it on facebook or twitter for example), it gives only the decoded URL, which makes it ugly. For example, in the address bar, the URL appears like this one: https://www.chaino.com/وذكر But when trying to copy and paste it in any other place, it gives the following ugly url: https://www.chaino.com/%D9%88%D8%B0%D9%83%D8%B1 & if I wanted to get the original URL to use it in any place, I used to decode it in this Raw URL Decoder - Online Tool Question is: is

URL as URL's get parameters - problem with “&”

醉酒当歌 提交于 2019-12-02 07:22:17
问题 There is script that receives another url as GET parameter: script.php?file=http://www.google.com&id=123 The problem is: when url has parameter itself, it is used as script's parameter, not that url's parameter: script.php?file=http://www.google.com?q=adsf&lang=en&id=123 URL is http://www.google.com?q=adsf&lang=en , but it is chopped after & , because it is viewed as related to script.php itself. What can I do about this? I tired to replace & with %26 , but url get broken with it. 回答1: You

URL as URL's get parameters - problem with “&”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 06:36:36
There is script that receives another url as GET parameter: script.php?file=http://www.google.com&id=123 The problem is: when url has parameter itself, it is used as script's parameter, not that url's parameter: script.php?file=http://www.google.com?q=adsf&lang=en&id=123 URL is http://www.google.com?q=adsf&lang=en , but it is chopped after & , because it is viewed as related to script.php itself. What can I do about this? I tired to replace & with %26 , but url get broken with it. You need to encode the value with the percent-encoding . If you’re using PHP, use rawurlencode (or urlencode if

java.net.URI chokes on special characters in host part

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 20:26:28
问题 I have a URI string like the following: http://www.christlichepartei%F6sterreichs.at/steiermark/ I'm creating a java.lang.URI instance with this string and it succeeds but when I want to retrieve the host it returns null. Opera and Firefox also choke on this URL if I enter it exactly as shown above. But shouldn't the URI class throw a URISyntaxException if it is invalid? How can I detect that the URI is illegal then? It also behaves the same when I decode the string using URLDecoder which

java.net.URI chokes on special characters in host part

五迷三道 提交于 2019-12-01 19:11:53
I have a URI string like the following: http://www.christlichepartei%F6sterreichs.at/steiermark/ I'm creating a java.lang.URI instance with this string and it succeeds but when I want to retrieve the host it returns null. Opera and Firefox also choke on this URL if I enter it exactly as shown above. But shouldn't the URI class throw a URISyntaxException if it is invalid? How can I detect that the URI is illegal then? It also behaves the same when I decode the string using URLDecoder which yields http://www .christlicheparteiösterreichs.at/steiermark/ Now this is accepted by Opera and Firefox