English 中文(简体)
谁对URLencoding进行脱节?
原标题:Who does decoding for URLencoding?

I have encoded my string(Say String a="123+gtyt") using URLEncoder class.The encoded string is String b. Then I am sending "String b" as a parameter appended to a URL. Lets say to http://example.com?request=b.

当I Decode the String at example.com使用URLDecoder, 我在座标上的符号+没有,在脱条之后,我没有看到“星号”。

现在,在我印刷时,不把“String b”印成例子。 我获得一个确切的

因此,我怀疑脱钩是否由浏览器本身在改用方向时进行?

最佳回答

在“123+gtyt”号编码时,该代码加标。

当你处理吉大港山区的请求时,服务器自动将其编码改为“123+gtyt”。 如果你重新编号,则将“+”改为空间。

因此,关键是——不明确编码参数。

例如:

    final String encoded = URLEncoder.encode("123+gtyt");
    final String decoded = URLDecoder.decode(encoded);
    System.out.println("decoded = " + decoded); // 123+gtyt
    System.out.println("URLDecoder.decode(decoded) = " 
              + URLDecoder.decode(decoded)); // prints 123 gtyt
问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...