java urlencode problem [message #8670] |
Fri, 01 December 2006 07:32 |
arnargestsson
Messages: 3 Registered: November 2006
|
Junior Member |
|
|
Hi,
I've recently made use of Openvz in our environment. My experience is that it works very well. Our servers are mainly Apache/Tomcat webservers and I use Centos-default template. However, I've stumbled across one thing that I've not been able to solve its that
url-encode-ing behaves differently on the VE than on the host it selv. That is to say when I urlencode for example "árar" I get from the VE
%3Frar
%3Frar
but on the host I get
%E1rar
%E1rar
which what I expected. I've made a small test rutine in java to test it, I pasted it in here below.
I wonder if any of you have come across this? All help would be greatly appreciated.
TIA
Arnar
-------------------------- Code snip ------------------
import java.net.*;
import java.io.*;
public class urlenctest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String enc="";
try{
if( args.length > 1 ){
enc = args[1];
}
System.out.println(URLEncoder.encode(args[0]));
System.out.println(URLEncoder.encode(args[0], enc));
}catch( UnsupportedEncodingException ue ){
ue.printStackTrace();
}
}
}
|
|
|
|
|
|
|