问题标签 [urldecode]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
4660 浏览

c# - 将 url 从 utf-8 编码重新编码为 iso-8859-1 编码

我有带有非英文字符的 file:// 链接,这些字符是用 UTF-8 编码的 UrlEncoded。为了让这些链接在浏览器中工作,我必须重新编码它们。

变成

我有以下有效的代码:

有更清洁的方法吗?

0 投票
1 回答
15117 浏览

.net-4.0 - 在 C# .NET 4.0 Visual Studio 2010 控制台应用程序中调用 UrlDecode?

好的,由于某种原因,Microsoft 删除了 System.Web,但我们可以导入 System.Net.WebUtility 并调用 HtmlDecode(),但我们如何调用 UrlDecode()?

请仅回答 .NET 4.0/VS2010 B2。

0 投票
5 回答
3214 浏览

php - PHP urlencode 和解码

全部,

有一个文字区说

如果用户给出的输入为,

当数据发布在服务器端时,数据会被接收,因为这是我的名字,我的邮件 ID 是 \"a@x.com\"

在双引号后面添加反斜杠。现在如何在提交之前对数据进行编码。我在服务器端使用 php..

谢谢。

0 投票
3 回答
1303 浏览

jquery - JQUERY AJAX,发送到服务器的空间问题,为什么?

我正在使用以下代码发布到服务器,然后将其发送到 MYSQL 查询以通过搜索查找匹配项。

当 Q 的 val 中有空格时,就会产生问题。我想知道我是否正确处理了这个问题?我需要对 AJAX 调用中的值进行编码吗?或者这是我的后端的问题,即 ColdFusion

现在 JQUERY 正在向服务器发布以下内容:/search/spotlight/?q=FirstName%20LastName

这是正确的吗?

0 投票
1 回答
14386 浏览

javascript - jQuery urlencode/decode 补丁帮助

我正在使用这个 jQuery urlencode 和 urldecode 插件 - 非常简单易用,但它不会以其原始形式+从字符串中删除。主页上的一条评论建议了一个补丁,但我不知道如何实现它。谁能帮我吗?

页面:http ://www.digitalbart.com/jquery-and-urlencode/

建议的补丁:

谢谢!

0 投票
1 回答
321 浏览

urldecode - 如何解码此数据

我在数据库中有一个类型为 bytea 的字段,这是以下数据的示例: \254\355\000\005sr\000\014java.net.URL\226%76\032\374\344r\003\ 000\007I\000\010hashCodeI\000\004portL\000\011authorityt\000\022Ljava/lang/String;L\000\004fileq\000~\000\001L\000\004hostq\000~\000\001L\000\ 010protocolq\000~\000\001L\000\003refq\000~\000\001xp\377\377\377\377\377\377\377\377t\000\021asm.objectweb.orgt\000\013/index. htmlq\000~\000\003t\000\004httppx

我需要将此数据转换为可读的 URL,你知道我该怎么做吗?这是什么类型的编码?

谢谢!

0 投票
2 回答
915 浏览

java - 在 AppEngine 中解码国际字符

我正在 Google AppEngine 中制作一个小项目,但我遇到了国际字符的问题。我的程序通过 url "page.html?data1&data2..." 从用户那里获取数据并将其存储起来以供以后显示。

但是,当用户使用一些国际字符(如 åäö)时,它会被编码为 %F4、%F5 和 %F6。我认为这是因为 http-requests 中只允许 ASCII 表中的前 128(?)个字符。

有没有人对此有很好的解决方案?任何简单的方法来解码文本?是在存储数据之前解码它更好,还是在向用户显示它时解码它。

0 投票
2 回答
32507 浏览

php - 如何在 php 中解码 url,其中 url 用 encodeURIComponent() 编码

如何在 php 中解码使用 encodeURIComponent() 编码的 url?

我已经尝试了 urldecode() 但也..我没有我编码的 url ......

我必须在 php..

0 投票
2 回答
2778 浏览

php - 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&searchscope=10&SORT=D/Xllamas&searchscope=10&SORT=D&SUBKEY=llamas/51%2C64%2C64%2CB/browse

The php docs page for urldecode advises against decoding request data, and says that it will already be decoded. I need it either completely decoded, so I can encode it again without double-encoding some parts, or not decoded at all.

I'm not sure why my experience of this data is incongruous with the php docs. Appreciate any help or pointers to same!!

EDIT: attempt to post relevant code, which is scattered about:

the url is encoded and added to the querystring (in an html file using smarty template):
<a class="button" href="{$baseurl}search_nojs?searcharg={$searcharg|escape:'url'}&url={$next|escape:'url'}"><span>Next&gt;&gt;</span></a>

if that link was followed, i'm grabbing the url back out of the querystring (in a php file):

Then I'd like to stick the url back into the querystring for the next link (in another html file):
href="{$baseurl}detail?bibid={$res.bibid}&searcharg={$searcharg}{if $searchurl}&searchurl={$searchurl}{/if}"

I'm also printing {$searchurl} straight onto the page, and getting the same half-escaped result.

Here is another example of the querystring vs. the data i get from $_REQUEST:

originally encoded url in querystring:
searcharg=mammals&url=http%3A%2F%2Fexample.com%2Fsearch%7ES10%3F%2FXmammals%26searchscope%3D10%26SORT%3DD%2FXmammals%26searchscope%3D10%26SORT%3DD%26SUBKEY%3Dmammals%2F51%252C1114%252C1114%252CB%2Fbrowse

data retrieved from $_REQUEST:
searcharg=mammals&searchurl=http://example.com/search~S10?/Xmammals&searchscope=10&SORT=D/Xmammals&searchscope=10&SORT=D&SUBKEY=mammals/51%2C1114%2C1114%2CB/browse

I know this method may seem curious -- I am trying to make a mobile display, working around a black-box database. Thanks again for any help!!

0 投票
3 回答
1185 浏览

url - GWT: library for encoding/decoding arbitrary data in URL fragments

Ajax applications, and GWT in particular, use the URL fragment (e.g. http://example.com/myapp#fragment) to maintain application state on the client without reloading the page.

Is there a GWT library that facilitates the encoding and decoding of arbitrary parameters into the URL fragment? I'm looking for something analogous to the Servlet API's getParameter() method, but for client-side URL parameters.