OpenVZ Forum


Home » General » Support » java urlencode problem
java urlencode problem [message #8670] Fri, 01 December 2006 07:32 Go to next message
arnargestsson is currently offline  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();
}
}

}
Re: java urlencode problem [message #8671 is a reply to message #8670] Fri, 01 December 2006 10:09 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

I guess you have different default locales on the host and inside VE:
# echo $LANG
# set | grep LC

also please keep in mind, that some of the templates have no other locales except for C. So you need to make:
# rpm -ihv --force glibc-common.rpm
in order to restore all locales.
Search forum for this.


http://static.openvz.org/userbars/openvz-developer.png
Re: java urlencode problem [message #8674 is a reply to message #8671] Fri, 01 December 2006 12:25 Go to previous messageGo to next message
arnargestsson is currently offline  arnargestsson
Messages: 3
Registered: November 2006
Junior Member
Hi,

sorry but my initial email didn't contain everything i had done. I had already tryied to tweak the LANG environment and both the host and the VE have now

en_US.iso8859-1

set|grep LC

gives nothing in both servers and glibc-common is already installed. I'm using Centos default template if that says anything. Do you believe I need to reinstall glibc-common?

TA
Arnar
Re: java urlencode problem [message #8724 is a reply to message #8674] Mon, 04 December 2006 18:16 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

yes, you need to reinstall, since some templates have stripped locales(!) for much smaller size.

check this thread:
http://forum.openvz.org/index.php?t=tree&goto=7804&& amp;srch=postgresql#msg_7804


http://static.openvz.org/userbars/openvz-developer.png
icon6.gif  Re: java urlencode problem [message #8730 is a reply to message #8724] Mon, 04 December 2006 20:41 Go to previous message
arnargestsson is currently offline  arnargestsson
Messages: 3
Registered: November 2006
Junior Member
Hi guys,

this solved the issue. The thing is to fetch the glibc-common from the original distribution.

Thanks for the help.

BR.

Arnar
Previous Topic: *SOLVED* not /etc/init.d/vz in debain package
Next Topic: Reboot
Goto Forum:
  


Current Time: Thu May 09 16:33:43 GMT 2024

Total time taken to generate the page: 0.01641 seconds