Title | Accented Characters Converted Badly |
Date | 27-Apr-2006 16:31:48 EEST |
Version | 2.4.0 |
Submitter | Jérôme Duprez |
Bug criticality | MediumBug |
Browser version | Firefox |
Bug status | OpenBug |
PageProvider used | |
Servlet Container | Tomcat 5.5.9 |
Operating System | Windows XP Pro |
URL | http://www.jspwiki.org/wiki/JeromeDuprez![]() |
Java version | 1.5.0_06 |
Non latin or non-ASCII7bits characters in certain links are incorrectly escaped by the latest 2.4 engine.
For example, my user page JérômeDuprez is unreachable through a link:
- the link points to JÃRÃ Me Duprez, converted as http://www.jspwiki.org/wiki/J%C3%A9r%C3%B4meDuprez), which does not exist
- whereas it is OK if I write it down in the URL http://www.jspwiki.org/wiki/JérômeDuprez, which gets rewritten as http://www.jspwiki.org/wiki/J%E9r%F4meDuprez
I spotted the problem with the accented characters in my name, but it also surfaces with asian characters, and presumably lots of non-7bits-ASCII characters. That's why I dare to increase the severity.
Works perfectly on Tomcat 5.5.16 on OSX... It's probably a configuration, not an engine issue...
Yup. Tomcat 5.5. requires URIEncoding="UTF-8" in the proper Connector block of the server.xml file. For example, for the AJP 1.3 connector with Apache, it might say:
<!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" className="org.apache.coyote.tomcat4.CoyoteConnector" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" connectionTimeOut="120000" acceptCount="200" maxThreads="250" minSpareThreads="25" maxSpareThreads="75" URIEncoding="UTF-8"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="apache_log." suffix=".txt" timestamp="true"/> </Connector>
Should be working now. -- JanneJalkanen
-- JDuprez right, I configured this for my HTTP connector on 8080, and it worked. Thanks for the support.
Even if it turns out not to be a JSPWiki bug, it deserves some mention in the install documentation (I installed Tomcat out of the box on WinXP, default configuration really). OK I know your answer: feel free to edit the install page :o) Fine, I'll do that.
Update: I reopen this bug based on new info below. I lower severity though, as there truly is a workaround.
Functionally it appears as a regression between 2.2.33 and 2.4.0 : until I upgraded my Wiki engine to 2.4.0 it did not exhibit this problem regardless of the URIEncoding setting.
- To make sure, I have:
- removed the URIEncoding field from server.xml
- run two Wiki web apps (one jspWiki 2.2.33 and another jspWiki 2.4.0) in the same Tomcat instance
- they demonstrate different behavior:
- 2.4.0 exhibits the problem
- whereas 2.2.33 works fine
- when I specify URIEncoding="UTF-8", both versions work fine.
The reason why they are different is probably because you have enabled ShortViewURLConstructor on 2.4.0. Tomcat decodes paths using different rules than parameters...
--JDuprez Fair enough, sounds logical. Note however, that I didn't explicitly specify this URL setting; here is the extract of my jspwiki.properties, related to URLConstructor. notice that everything is comented out (default setting):
#jspwiki.urlConstructor = DefaultURLConstructor #jspwiki.urlConstructor = ShortViewURLConstructor #jspwiki.shortURLConstructor.prefix = /wikiIs ShortViewURLConstructor the default?
Apologies for insistively following up. Strictly speaking, if you're right, this is not a bug report but a support request. Please let's keep the bug open until the reason is sorted out though...
No, the DefaultURLConstructor is the default. What kind of URLs are you getting?
-- JDuprez Well, the same as witnessed on this site when I reported this bug: [JérômeDuprez] generates a link http://localhost:8080/MyWiki/Edit.jsp?page=J%C3%A9r%C3%B4meDuprez, to a page named JÃRÃMeDuprez.
To be honest I'm less concerned by this issue now that I've configured the URIEncoding flag on the couple of Tomcat instances I routinely use. I'll redo the test next time I upgrade the wikis engine version.