url-encoding

Response.Redirect occasionally ignores URL encoding

In the website I'm currently building we need a large number of dynamic redirects, in order to maintain flow through parts of the site. I'm currently using response.redirect to achieve this, with the redirection URL being dynamically generated in the code behind on the postback method of various buttons. This is fine in 95% of the case...

Encoding/decoding REST path parameters

I am trying to find the best way of getting round a design flaw in a web app I'm helping to support. One part of the service passes a parameter ("myparam") to a .jsp page, which in turn calls a REST service including our myparam as a path parameter. The design flaw bit is that myparam should be passed as a form parameter, since it can be...

jQuery.post and encoding

I have a form in a webpage, where the user can enter any arbitrary html. Once he clicks submit, I am sending the content to the webserver via AJAX using jQuery.post(). But for certain HTML, I am getting this response from the server HTTP/1.0 400 Bad Request Content-Type: text/plain Date: Mon, 26 Oct 2009 05:28:00 GMT BAD REQUEST: Bad...

Test if string is URL encoded in PHP

Hey guys, I've looked through the PHP Docs and can't see anything to do with this, so how can I test if a string is URL encoded? Is it better to search the string for characters which would be encoded, which aren't, and if any exist then its not encoded, or use something like this which I've made function is_urlEncoded($string){ $test...

Is there any exist API for URL-encoding in mfc c++?

I am using the following code: CAtlNavigateData navData; CStringA m_strForm = "name=+++&priv=1&password="; navData.SetPostData((BYTE*)(LPSTR)(LPCSTR)m_strForm, m_strForm.GetLength(), QHTTP_FORM_URLENCODE); special symbols such as :"+++" need to do url-encoding, without url-encoding, +++ will turned into space. I need a converer. CSt...

Percent Encoded UTF-8 to Ascii(8-bit) conversion

Im reading in urls and they often have percent encoded characters. Example: %C3%A9 is actually é According to http://www.microsystools.com/products/sitemap-generator/faq/character-percentage-url-encoding/ , characters in the upper half of 8-Bit ASCII (128-255) are encoded as UTF-8, then their bytes are saved as hex. Now, when I get my ...

How do I parse an encoded URI in Ruby?

I'm trying to parse a URI that has brackets - [ and ] - in it. I have tried to parse this directly with URI.parse but the brackets cause this to fail. I therefore tried to encode the URI with CGI::escape which takes care of the brackets but when I try to parse this encoded URI with URI.parse it doesn't seem to recognise it as a URI and p...

how to deal with question mark in url in php single entry website

I'm dealing with two question marks in a single entry website. I'm trying to use urlencode to handle it. The original URL: 'search.php?query='.quote_replace(addmarks($search_results['did_you_mean'])).'&search=1' I want to use it in the single entry website: 'index.php?page='.urlencode('search?query='.quote_replace(addmarks($search...

What kind of text code is %62%69%73%68%6F%70?

On a specific webpage, when I hover over a link, I can see the text as "bishop" but when I copy-and-paste the link to TextPad, it shows up as "%62%69%73%68%6F%70". What kind of code is this, and how can I convert it into text? Thanks! ...

How to mimic ASP Server.URLEncode in ASP.NET?

In ASP: Server.URLEncode("+&(). -*<>/\|") ' returns %2B%26%28%29%2E+%2D%2A%3C%3E%2F%5C%7C In ASP.NET Uri.EscapeDataString("+&(). -*<>/\|") // returns %2B%26().%20-*%3C%3E%2F%5C%7C HttpUtility.UrlEncode("+&(). -*<>/\|") // returns %2b%26().+-*%3c%3e%2f%5c%7c Is there any elegant way how to mimic old ASP behavior in ASP.NET? ...

How to handle '&' in URL sent as HTML from iPhone Mail.app

Apologies if this has been answered already. There are similar topics but none that I could find pertaining to Cocoa & NSStrings... I'm constructing a clickable URL to embed in an HTML email to be sent via the MFMailComposeViewController on the iPhone. i create the url then use stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncod...

when assigning location.href, please explain url encoding (in asp.net and firefox)

In some javascript, I have: var url = "find.aspx?" + "location=" + encodeURIComponent( address ); alert( url ); location.href = url; where the value of address is the string "Seattle, WA". In the alert I see find.aspx?Seattle%2C%20WA as I expect. But on the server side, when I look at Request.Url, the relevant substring I see is ...

NSDictionary: URL-Encoding

Can anyone please review the following method and tell me if it is necessary to release the enumerator for the dictionary keys after using it? I'm new to objective c and not always sure, when to release variables returned from the SDK methods. I suppose the keyEnumerator method returns an autoreleased instance so I don't have to care abo...

Losing characters in web based string parsing using query strings

Hi, I am trying to request a webpage from an iis web server that I control utilising query strings. E.g., I have a webbrowser control in my winforms app and request a page similar to "www.site.com/getpage.ashx?field=afsfgwesar+sere" When i try to run this it fails because on the server side, getpage.ashx can’t locate the right field. ...

Help with C# HttpWebRequest URI losing its encoding

Having a problem with HttpWebRequest decoding my encoded URL. var requestUrl = "https://www.google.com/webmasters/tools/feeds/http%3A%2F%2Fwww%2example%2Ecom%2F/crawlissues/"; var request = (HttpWebRequest)WebRequest.Create(requestUrl); When looking at end request URL is becomes: https://www.google.com/webmasters/tools/feeds/http:...

How to find out if string has already been URL encoded?

How could I check if string has already been encoded? For example, if I encode TEST==, I get TEST%3D%3D. If I again encode last string, I get TEST%253D%253D, I would have to know before doing that if it is already encoded... I have encoded parameters saved, and I need to search for them. I don't know for input parameters, what will th...

URL Encoding to support special chars + and &

I have a WCF REST service which retrieves data from the database. I would like to retrieve strings containing special chars like *, (, +, &, etc from the database using GET. I tried URLEncode of the query string. This works for some chars like *, (. But it does not work for chars like + and &. I would like to know of a way to retrieve st...

Using GWT History to pass parameters?

I have a page called Orders and a page called OrderDetails. As described in the excellent MVP tutorial I'm working with History (with a central ValueChangeListener) and an "event bus" HandlerManager. I have a handler registered for the event that someone clicks on an order, which basically creates the OrderDetailPresenter, passes in the...

Encoding hyperlinks - when and how?

Hey everyone, I have a security related question. My web application allows users to input URLs. The URL is immediately stored in the database (no santization at this point. Is this wrong?). I'm using Linq to SQL so it's already parameterized. When displaying the hyperlink back to the user, I'm using a repeater. Do I need to encode the...

Request.QueryString[] does not return my desired value

I have the following URL: /Login.aspx?ReturnUrl=Default.aspx#/mydesign Request.QueryString["ReturnUrl"] only returns "Default.aspx". Why doesn't it return "Default.aspx#/mydesign"? ...