|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
encodeURIComponent equivalent in Java
Is there an equivalent for encodeURIComponent in Java? |
#2
| |||
| |||
Re: encodeURIComponent equivalent in Java
Do you think you could explain in detail what it does or give a link to some documentation of this function? It would make it much easier for people to answer your question. |
#3
| |||
| |||
Re: encodeURIComponent equivalent in Java
encodeURIComponent is a JavaScript URI Encoding function. See: http://msdn.microsoft.com/library/de...icomponent.asp |
#4
| |||
| |||
Re: encodeURIComponent equivalent in Java
I'm not sure about the subtle differences between URI and URL. But I think URLEncoder.encode(String) is roughly what you want. <http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html#encode(java.lang.String)> |
#5
| |||
| |||
Re: encodeURIComponent equivalent in Java
Since I'm UTF-8, I will add that URLEncoder.encode(x, "UTF-8") will ensure all non-ASCII characters are also escaped in byte pairs (see http://www.w3.org/TR/html40/appendix...on-ascii-chars. After many hours of pondering this character set problem () I discovered that the standard is and doesn't allow character sets other than US-ASCII in the URL. So the above way is the defacto standard. That is all, time for the |
![]() |
|
Tags: java |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Equivalent to Java finally keyword in PHP | Jaganmohini | Software Development | 6 | 12-08-2010 10:20 AM |
ATI equivalent to GTX 260 SLI | Tanveer Joshi | Monitor & Video Cards | 6 | 18-05-2010 12:00 AM |
Need some equivalent applications for MAC | Abhibhava | Windows Software | 5 | 27-12-2009 01:04 AM |
Equivalent of #define in C# | Luis234 | Software Development | 6 | 20-04-2009 11:56 PM |
Equivalent of the TAT | Xeusion | Overclocking & Computer Modification | 3 | 26-11-2008 07:19 PM |