urlencode

Unicode and URI encoding, decoding and escaping in JavaScript

If you look at this table here, it has a list of escape sequences for Unicode characters that don't actually work for me. For example for "%96", which should be a –, I get an error when trying decode: decodeURIComponent("%96"); URIError: URI malformed If I attempt to encode "–" I actually get: encodeURIComponent("–"); "%E2%80%93" ...

ASP.NET MVC - creating and handling with URLs with Greater Than and Less Than characters

Consider a link to a page for a user's profile. A page is creating that URL like this: //Model.Name has value "<bad guy>" Html.ActionLink("foo, "ViewUser", new { id=5, title=Url.Encode(Model.Name) }) The actual outcome was http://mysite/Users/5/%253cbad%2guy%253e When navigating to that URL, the server generates a HTTP Error 400 - ...

JS encodeURIComponent result different from the one created by FORM

I thought values entered in forms are properly encoded by browsers. But this simple test file "test_get_vs_encodeuri.html" shows it's not true: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html><head> <meta http-equiv="Content-Type" content="text/html; charset=windows-125...

A definitive guide to Url Encoding in ASP .NET

I am starting to realise that there are about a bazillion different methods for encoding urls in .NET. I keep finding new ones. They all work slightly differently, but they all have essentially the same summary comments. Does anyone have a definitive matrix that shows the exact differences between the following methods: HttpUtility.Url...

PHP doesn't properly URL-decode POST values, or is the bug somewhere else?

I have a PHP website that integrates with PayPal. As part of it's normal operation it sends a POST request to a user defined URL about every transaction (and some other events). It's called IPN for those who know. All was/is working just fine, until we moved to a new hosting provider last week. This naturally resulted in downtime, chang...

when to encode space to plus (+) and when to %20 ?

Sometimes the spaces get url encoded to + sign, some other times to %20, what is the difference and why and why not this happens? ...

MOSS Filter webpart not working with & symbol in the query string

Hi, I know this is a fairly common error with URL encoding. The problem I suspect is the MOSS Filter webpart used to filter a dataview webparts results based on the querystring paramter passed to it from the Filter webpart. When the query string contains an & (ampersand) symbol the dataview webpart is unable to display any results but ...

Send Server.UrlEncoded XML in querystring Causing Error

I'm trying to send a string of XML as part of the query string. Normally I'd POST this XML but I'm sending it to a 3rd party system that I can't POST stuff to. So, as it goes, I need the 3rd party system to request the services of one of the pages in my system. (explanation: the 3rd party system produces PDFs of my web pages. I give it...

How do I pass session variables from one domain to another in PHP

Hi everyone, I have encountered a situation where I need to pass $_SESSION variables from one domain to an iFrame page from another domain. I have spent the last 16 days trying various methods to no avail. I think that the only logical way would be to encode the variables in the url that calls the iFrame and decode them in th iFrame pag...

URL Encoding of Characters in a password field

I am trying to pass login credentials to a PHP script that I have in my iPhone app. When I pull a password with special characters the password is missing certain characters especially the percent sign. I am trying to encode the text but even before I send it, the percent sign is missing. //p_field is a UITextField holding the passwor...

UrlEncoding-Safe Delimiter

So the site I'm working on has a filter system that operates by passing a key and value system through a querystring. The whole site is going through a re-factor soon and I'm maintaining the existing site so before we discuss the RIGHT way to implement this, I just need ideas for changing my delimiter. The current format is like this: ...

How to decode the url in php where url is encoded with encodeURIComponent()

Hey Guys, How to decode the url in php where url is encoded with encodeURIComponent()? I have tried the urldecode() but then also..i don't the url which i have encoded... I have to do this in php.. ...

PHP urlencode() tacking on ?SID=xxx ... Why?

I am trying to output a simple link. This works great: $url = 'http://www.google.com'; echo $url; This doesn't work great: $url = 'http://www.google.com'; echo urlencode($url); The second example tacks on "?SID=xxx" to the end of the URL for some reason. How do I prevent this from happening? Note: The code to generate the URL ha...

Building Reducisaurus URLs

I'm trying to use Reducisaurus Web Service to minify CSS and Javascript but I've run into a problem... Suppose I've two unminified CSS at: http:/domain.com/dynamic/styles/theme.php?color=red http:/domain.com/dynamic/styles/typography.php?font=Arial According to the docs I should call the web service like this: http:/reducisaurus.app...

struts2 result param not working

I am trying to figure out what is going on here... I have an action class with the standard getters/setters and lets say i have one for a property called 'category'. in my result mapping for the action in the struts.xml file, i am trying to add the value of this property to the URL for an action redirect. in my action class, i can ...

In php, Prepare string and create XML/RSS Feed

I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid. I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does...

Python 3.1 twitter post with installed library,

I'd like to be able to post twitter messages from python 3.0. None of the twitter API I have looked at support python 3.1. Since the post proceedure only requires this : JSON: curl -u username:password -d status="your message here" http://api.twitter.com/1/statuses/update.json I was wondering if it is possible with the standard libra...

urlencode except /

Is there a way to urlencode except directory seperators / in the path ? like urlencode('/this/is/my/file right here.jpg'); ...

php $_REQUEST data is only half-decoded

I am retrieving an encoded url via querystring. I need to pass it again to the next page. When I retrieve it the first time, using $_REQUEST['url'], only the slashes are decoded, e.g: http://example.com/search~S10?/Xllamas&amp;searchscope=10&amp;SORT=D/Xllamas&amp;searchscope=10&amp;SORT=D&amp;SUBKEY=llamas/51%2C64%2C64%2CB/browse Th...

Tidy breaks links with not-latin chars

I use java library Tidy to sanitize html-code. Some of the code contains links with Russian letters. For example <a href="http://example.com/Русский"&gt;link with Russian letters</a> I understand that "Русский" must be escaped, but I get this html from users. And my job is to convert it to XHTML. I think tidy tries to escape not-lati...