Bug 507679 - DocSearch: Problem with encoding of i18n strings
DocSearch: Problem with encoding of i18n strings
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: John Matthews
Milan Zazrivec
:
Depends On:
Blocks: 457073
  Show dependency treegraph
 
Reported: 2009-06-23 14:23 EDT by John Matthews
Modified: 2009-09-10 15:32 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 15:32:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Matthews 2009-06-23 14:23:50 EDT
Description of problem:

Documentation search is displaying corrupted results for languages like Hindi.

When submitting the query for say "पंजीयन"
The string to search on is changing to:   "पंजीयन"


Version-Release number of selected component (if applicable):
ISO: Satellite-5.3.0-RHEL5-re20090619.0-i386-embedded-oracle.iso


How reproducible:
Always

Steps to Reproduce:
1. Change locale to Hindi in Firefox or Set this as your locale choice in Satellite.
2. Go to: /rhn/help/Search.do
3. Enter: "पंजीयन"  as your search term
  
Actual results:
The search string is translated to: "पंजीयन"
The results also look incorrect with bad characters which do not represent Hindi.

Expected results:
The search string should remain: "पंजीयन"
The results should be in Hindi characters




Additional info:
Comment 1 John Matthews 2009-06-23 14:35:26 EDT
Here is background on the problem.

1) We submit a form with a unicode character string.
2) The java action "DocSearchSetupAction" receives the string in the correct encoding, the locale is set to Hindi and the encoding is set to "UTF-8".
3) The action processes the form vars, then stuffs them into request parameters and does a forward.
4) We enter back into DocSearchSetupAction, now we are getting our parameters from a "GET".   The searchString has been changed at this point.

Character encoding operates on the content and on the get parameters separately.  I believe the issue here is that the GET parameters are not being encoded as UTF-8.

A fix that looks to work is to add add an attribute "URIEncoding="UTF-8" to the Connector element.

Example:  /etc/tomcat5/server.xml

      <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" 
               URIEncoding="UTF-8" />


    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" 
        enableLookups="false" redirectPort="8443" protocol="AJP/1.3" 
        URIEncoding="UTF-8"/>




For more info see:  
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q2
Comment 2 John Matthews 2009-06-24 17:58:17 EDT
This is the fix in VADER branch

 spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/tomcat5/server.xml |  394 ++++++++++
 1 file changed, 394 insertions(+)

New commits:
commit b0d90ccfcb4298fbc5e8aced5231a7fd390945dc
Author: John Matthews <jmatthew@redhat.com>
Date:   Wed Jun 24 11:42:14 2009 -0400

    507679 - Set URIEncoding to UTF-8 for tomcats server.xml config file
    Intent of this change is to force encoding of GET parameters to be in UTF-8
    This is the default server.xml from tomcat RPM with a change of URIEncoding="UTF-8"
    added to the Connector elements.
    For background info reference: http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q2




TESTPLAN Note:

While testing, please verify that /etc/tomcat5/server.xml
contains URIEncoding="UTF-8" for the connector element on port 8009 as per comment 1.
Comment 3 Milan Zazrivec 2009-07-09 08:14:11 EDT
Verified, spacewalk-search-0.5.10-14, /etc/tomcat5/server.xml:
...
<Connector port="8009" 
        enableLookups="false" redirectPort="8443" protocol="AJP/1.3" 
        URIEncoding="UTF-8"/>
...
Comment 4 Miroslav Suchý 2009-08-17 09:07:37 EDT
verfied in stage. the search string remains पंजीयन
Comment 5 Brandon Perkins 2009-09-10 15:32:47 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

Note You need to log in before you can comment on or make changes to this bug.