Menu
  • HOME
  • TAGS

How to correctly use UrlEncode and Decode

c#,azure,encoding,urlencode,urldecode

It works if you use WebUtility.UrlEncode instead of HttpUtility.UrlPathEncode If you check out the docs on HttpUtility.UrlPathEncode you'll see that it states: Do not use; intended only for browser compatibility. Use UrlEncode. I've coded up a simple example which can be pasted into a console app (you'll need to reference...

Disable Url Encoding in ASP.NET MVC

asp.net-mvc,urldecode

You should be fine to remove the url encoding and just use the built in Razor Url encoding, which is applied automatically when using @: public static string BuildImageUrl(int realtyId, string filename, int w, int h) { filename = Path.GetFileNameWithoutExtension(filename); // no url encoding here! return string.Format("/photo/{0}/{1}/{2}x{3}", realtyId, filename, w,...

URL Decode inside Lotusscript agent IBM Domino

ibm,lotus-domino,lotusscript,agent,urldecode

Unfortunately there is no default URLdecode- function in LotusScript. I always use Evaluate for this: Dim varResult as Variant Dim strUrl as String Dim strUrlDecoded as String strUrl = "Employee%2FMy%20Database.nsf" varResult = Evaluate( {@URLDecode( "Domino"; "} & strUrl & {" )} ) strUrlDecoded = varResult( 0 ) ...

JSON object passed in the php script [closed]

php,json,urldecode

You are passing true as second parameter to json_decode, it will return and array not object. Try with - $order_json = json_decode($get_order_info, true); echo $order_json['mealsInfo'][0]['DrinkSize']; ...

JavaScript how to replace %20 to space

javascript,angularjs,urldecode

this is encoded url part, you should use decodeURIComponent() function and pass encoded string in first param, see sample code decodeURIComponent("john%20doe"); //> john doe ...

> not being urldecoded

cakephp,get,urldecode

use htmlspecialchars_decode() function instead of urldecode()

Urldecode in batch file

url,batch-file,urldecode

This may be achieved in pure Batch... @echo off setlocal EnableDelayedExpansion set "input=http://www.example.com/some-page/some/link.html" rem Define the equivalences for %%a in ("#x3a=:" "#x2f=/") do ( for /F "tokens=1,2 delims==" %%b in (%%a) do set "replace[%%b]=%%c" ) echo Input = "%input%" set "input=%input:&=\%" set "output=" for %%a in (%input%) do ( for...

Why can't “decodeURIComponent” or “decodeURI” decode “hello+world” to “hello world” in JavaScript? [duplicate]

javascript,url,urlencode,urldecode

The behavior of decideURIComponent is defined as "inverse" operation of encodeURIComponent: The decodeURIComponent function computes a new version of a URI in which each escape sequence and UTF-8 encoding of the sort that might be introduced by the encodeURIComponent function is replaced with the character that it represents. And encodeURIComponent...

Why doesn't nbsp display as nbsp in the URL

html,urlencode,urldecode

I suspect that this is due to differences between character encodings. The value A0 represents nbsp in the ISO-8859-1 encoding (and probably in other extended-ASCII encodings too). The page at http://www.url-encode-decode.com appears to use the UTF-8 encoding. Your problem is that there is no character represented by A0 in UTF-8....

Using urlencode() in form

php,html,urlencode,urldecode

You do not need to use them at all. Submitting a form will cause the browser to encode characters automatically. Since you are using PHP, $_POST will be populated with decoded characters automatically. If you are having character encoding issues where the characters are being encoded or decoded incorrectly, then...

Get specified parameter from encoded url paramters String with java

java,xml,urldecode

Since you say you don't want to hack it with a regex you might use a proper XML parser, although for such a small example it is probably overkill. If you can assume that you can simply split your string on &'s, i.e., there aren't any &'s in there that...

How to decode a 'url-encoded' string in python

python,urlencode,urldecode

Your input is encoded double. Using Python 3: urllib.parse.unquote(urllib.parse.unquote(some_string)) Output: 'FireShot3+(2).png' now you have the + left. Edit: Using Python 2.7 it of course is: urllib.unquote(urllib.unquote('FireShot3%2B%25282%2529.png')) ...

Output a part of URL in php

php,urldecode

You can use parse_url with second parameter PHP_URL_PATH $url = urldecode("http://example.com/name/first_name/last_name/John%2C+Smith"); $arr = array_filter(explode('/',parse_url($url, PHP_URL_PATH))); print_r(end($arr)); Edited: As per requirement for dynamic url you can use $url = urldecode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); ...

python url decode %E3

python,encoding,character-encoding,urllib,urldecode

The former is double-quoted UTF-8, which prints out normally since your terminal uses UTF-8. The latter is quoted Latin-1, which requires decoding first. >>> print 'Pedro_Miguel_de_Castro_Brand\xe3o_Costa' Pedro_Miguel_de_Castro_Brand�o_Costa >>> print 'Pedro_Miguel_de_Castro_Brand\xe3o_Costa'.decode('latin-1') Pedro_Miguel_de_Castro_Brandão_Costa ...

Why URL is not decoded completely?

java,urldecode

First, everything is working as expected. Your problem is, that the input-string is encoded twice. So simply decode it two times. Example: Input: %253A Decodes as: %3A Decodes as: : Code: String input = "40.2%2522%26url%3Dhttp%253A%252F%252Fr1"; String output1 = URLDecoder.decode(input, "UTF-8"); String output2 = URLDecoder.decode(output1, "UTF-8"); System.out.println(input); System.out.println(output1); System.out.println(output2); Output: 40.2%2522%26url%3Dhttp%253A%252F%252Fr1...

http.server: decoding POST request to JSON

python,json,python-3.x,post,urldecode

If you can change the request, then send it in JSON: import json payload={'text': 'bi ba buzemann!', 'nouns': ['streetlight', 'situation'], 'states': ['solid', 'fluid'] } requests.post(url, data=json.dumps(payload)) ...

tomcat double decode url

tomcat,urldecode,utf8-decode

i had problem after checking it in my wireshark , i have a problem in another place in the system ,i solve my problem.

Difference in encoded and decoded string

c++,string,zlib,url-encoding,urldecode

std::string in(i); The problem lies here; this std::string constructor expects a null-terminated string, so it truncates the data to the first 0 byte it finds (which is found early in the gzip output). You want to ask to curl_easy_unescape how long is the unescaped data and construct in accordingly:...