Hi-
I'm not using the Magnolia search form, so never had to fix this, but it's most
probably related to wrong default input encoding settings on the container.
Most containers default to ISO8859-1 for requests if the browser doesn't send an encoding. As the browser will send the query String UTF-8 encoded in the case of the search form, all special characters come out garbled.
There are quite a few ways to solve this problem:
1) Change the form to use POST instead of GET.
2) change the default request encoding of your container to UTF-8 (for tomcat
it's the URIEncoding attribute on the connector tag).
3) use request.setEncoding("UTF-8"). This will only work on a servlet 2.3 container, and the request encoding cannot be changed after the request has been read. So you will probably want to do this in a servlet filter that gets called before any other processing takes place
4) Convert the query parameter from iso to UTF-8 before using it, something like this: new String(q.getBytes("8859_1"), "utf-8")
I would prefer option 1), as UTF-8 encoded URLs are generally messy and a pain
to deal with.
HTH,
-markus
Jean Pierre Malrieu wrote:
I have not received answers to my question.
I am just a end-user, not a programmer. I want to use Magnolia for our
college, mainly because the UI is better than in other CMSes.
How do I do to have magnolia search functionality work with accentuated
characters?
Thanks.
JPM
Le 2 févr. 06 à 23:38, Jean Pierre Malrieu a écrit :
Hi,
I suppose this issue has been raised before, but I can't find the
answer from the list archives (by the way they are not very convenient
to search...).
It's great that magnolia includes a search functionality. Yet, from my
tests, It seems that out of the box, this functionality does not work
with accentuated characters...
If I have the word "général" in a page, then I can't find it by typing
"général" in the search text field, because it gets translated as
"général" in the search process.
As I know almost nothing about character encoding, and the way it is
passed in http requests, I can't find a solution myself. I suppose the
solution is straighforward for most of you. Could someone help me with
this?
Thanks.
JPM
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------