cancel
Showing results for 
Search instead for 
Did you mean: 

Reading special characters from URL.

Former Member
0 Kudos

Hi, all


Let me comment about we have a par file that reads a parameter from an URL. For example:

http://fetrbxrh:50000/irj/servlet/prt/portal/prtroot/MenusDinamicos_DC.archivosDinamicos?ruta=/docum...

This PAR works fine on ep6.20. But when we deploy it on ep7.0, some special characters can't be readed. for example the character (é) is changed to (?). We notice this changes at the Log Viewer or writing this information in a text file. At same way, these characters (á,í,ó) are changed to (?). This is an example of the change:

ruta = /documents/Portal_COM/KM/DC/Operaciones/Almacenes/M?xico

This PAR have an AbstractPortalComponent class to read the parameter. This is the code:

public void doOnNodeReady(IPortalComponentRequest request, IEvent arg1)
{
Registrador.escribe(Registrador.ERROR, "Archivos:doOnNodeReady " );
MenuData menuData = new MenuData();
Vector vecMenus =null;
StringBuffer strbPath = new StringBuffer("");

StringBuffer archivoFile= new StringBuffer("");
XmlMenu xmlMenu = null;
Connection conn = null;
String publicPath = request.getPublicResourcePath().toString();
String pathFile = "";

try{
conn = Conexion.getConexion();

String strRuta = request.getParameter("ruta");

if(Cadena.IsVoid(strRuta))

strRuta="";

this.setRuta(strRuta);

Registrador.escribe(Registrador.INFORMATIVA, " ruta = " + this.getRuta());

This PAR file was done in ECLIPSE 2.1.3 with the PDK plugins.

There is some special way to read these special characters or we need to configure something at application server?

Thanks and regards

Jose Angel Rodriguez Olvera

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Jose,

You should encode your URL while using special characters like '

é

' .
Check these articles to know more:
http://www.w3schools.com/tags/ref_urlencode.asp

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

While reading you should decode the parameters to get the originial character '

é

'.

Greetings,

Praveen Gudapati

p.s. points are always welcome for helpful answers

Former Member
0 Kudos

Hi, Praveen

Thanks for ask me so fast. I try these things, at client server I test with this URL:

http://fetrbxrh:50000/irj/servlet/prt/portal/prtroot/Acentos.default?ruta=M%E9xico

The encode symbol (%E9) is (é). At the server side I try printing this values in the Log viewer and writing in text file and it happen the same.

I try with this code's lines too:

String strRuta = request.getParameter("ruta");

String utf8_Ruta = URLDecoder.decode(request.getParameter("ruta"),"UTF-8");

String iso_Ruta = URLDecoder.decode(request.getParameter("ruta"),"ISO-8859-1");

byte strBytes[] = request.getParameter("ruta").getBytes();

Regards.

Former Member
0 Kudos

Hi all

The final solution, was using the url in this way:

http://fetrbxrh:50000/irj/servlet/prt/portal/prtroot/Acentos.default?ruta=M%C3%A1%C3%A9%C3%AD%C3%B3%...

Thank you!.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jose,

Thank you for the info. i just wanted to know, do you live in Dominican Republic (santo domingo)?

Former Member
0 Kudos

Hi Matt,

I'm from Mexico, was a pleasure. I'm begining with NW04 for EP7.0, What about you?, if you prefer this is my email (tmxjoseangel.rodriguez@kof.com.mx).

Former Member
0 Kudos

Hi again Jose,

The reason i asked because i met a gentleman in santo domingo while i was there with a same name as you (actually it was jose angel olvera), so i was wondering if it was you. small world )