[MAGNOLIA-630] Search won't work with accented characters Created: 09/Feb/06  Updated: 23/Jan/13  Resolved: 21/Sep/06

Status: Closed
Project: Magnolia
Component/s: samples
Affects Version/s: 2.1.3
Fix Version/s: 3.0 RC3

Type: Bug Priority: Minor
Reporter: Markus Strickler Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File post.patch    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If you try to serach for non ASCII characters with the dmaple serach form from templates/jsp/samples/search/search.jsp the search will fail and a garbled search term will be returned.



 Comments   
Comment by Markus Strickler [ 09/Feb/06 ]

This happens when the browser sends UTF-8 encoded query strings to a continer that expects ISO encoded requests.
Probably best way around this issue is to use POST in the search form.

Comment by Markus Strickler [ 09/Feb/06 ]

Patch to make the form use POST instead of GET

Comment by Philipp Bracher [ 09/Feb/06 ]

If magnolia get's a parameter due a GET post it doesn't it get UTF-8 decoded. At least this is what is happening in the tomcat 5.0.28.

I fixed this in the DMS and therfore I wrote a util method to get the parameter in UTF-8

use therfore: info.magnolia.cms.util.RequestFormUtil.getURLParameterDecoded()

This works fine.

Comment by Yves-Marie DANIEL [ 20/Jul/06 ]

Could you tell where to use info.magnolia.cms.util.RequestFormUtil.getURLParameterDecoded() ? in simpleSearch ? In which method ? I can't figure where...

Comment by Sameer Charles [ 21/Sep/06 ]

It depends how you pass this query string to search
Have a look at the admin central search, It keeps the string as sent by the client. You do not need to change anything in search API or tag but just decode the query string passed to it

Generated at Mon Feb 12 03:19:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.