cancel
Showing results for 
Search instead for 
Did you mean: 

Charset or encoding issue, please help!

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all,

I have successfully deployed my web scripts to my Tomcat instance and everything's fine. However, the problems appear when deploying the same code to JBoss.
Everything is fine except for the webscript encoding (or charset, I have no idea…)

For the following web script definition:
<webscript>
  <shortname>Spaces</shortname>
  <description>Generate the Spaces portlet page</description>
  <url>/ui/sosspaces?f={filter?}&amp;p={path?}</url>
  <authentication>user</authentication>
</webscript>

I'm sending that (from another web script):
http :// URL:8080/alfresco/service/ui/sosspaces?f=0&p=%2FCompany%20Home%2FTests%2FMyTest%20-%20Num1%2FRegion%20My%20Region%2FNew%20consultation%2FMar%C3%ADa

That's to say, for the second parameter: /Company Home/Tests/MyTest - Num1/Region/My Region/New consultation/María

And then, whereas Tomcat is receiving correctly the parameter: /Company Home/Tests/MyTest - Num1/Region/My Region/New consultation/María
The same code deployed in JBoss is receiving:                           /Company Home/Tests/MyTest - Num1/Region/My Region/New consultation/María

Why the "%2F" characters are recognized as "/" or "%20" as space character, but "%C3%ADa" is not the "í" character???

This webscript tries to retrieve the path's content and is failing because it can't be found. How can I fix it?? Is a JBoss configuration issue?? Must I set the charset or enconding of my web scripts? How?
Thanks!!

Sergi
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Your URLEncoding is not correct.    The code for the i with an accent is %ED

sergi_l
Champ on-the-rise
Champ on-the-rise
Thanks mrrogers, but I need more help… The URLEncoding is set by default, how can I change it?

The URL is generated from another webscript following this way:
${url.serviceContext}/ui/smsspaces?f=${args.f}&amp;p=${args.p?url}%2F${d.name?url}
So, the "${d.name?url}" is who's generating the code for the "i" with accent.

Let me explain you an easier scenario!
My script is just an extension of the Alfresco's out of the box My Spaces List web script (alfresco/service/ui/myspaces?f={filter?}&p={path?}). Let's think on it.
If I use it from the My Alfresco's dashboard, I can browse all the folders (including "María") and everything's fine.

Nevertheless, if I invoke it outside Alfresco, through the URL: http :// MyIP:8080/alfresco/service/ui/myspaces?f=0&p=
The web script is loaded showing the Company Home folder.
If I browse to the folder "María" it will fail again. The same problem.

Why does Alfresco work and all the characters are shown correctly also for web scripts, but the webscripts invoked outside directly from the browser (IE, Firefox) are failing?
The configuration is Suse linux + Oracle9 + JBoss

Thanks in advance!
Sergi