Jetspeed 2
  1. Jetspeed 2
  2. JS2-758

Ukrainian symbols doesn't save through Portal Site Manager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3, 2.2.0
    • Fix Version/s: 2.1.3, 2.2.0
    • Component/s: Admin Portlets
    • Labels:
      None
    • Environment:
      SuseLinux 10.1, Apache Tomcat 5.5.20, Java 1.5.10

      Description

      Ukrainian symbols doesn't save through Portal Site Manager

      Algorithm to achieve this bug:
      I've created page through Portal Site Manager. I'd entered text 'Some test page' into field 'Title' of Site Manager. I'd clicked 'Save'. I'd opened this page and its title really 'Some test page'.

      Next, I'd opened this page through Portal Site Manager. I'd entered some text in Ukrainian language. I'd clicked 'Save'. I'd opened this page and its title still 'Some test page'. I'd opened Portal Site Manager. The name of this page still 'Some test page'.

        Activity

        Hide
        Woonsan Ko added a comment -

        I could reproduce this problem with Korean characters, too.

        As a summary, IMO,
        (1) site-view.vm should be patched with the attachment.
        (2) Tomcat connector's URIEncoding should be set to 'UTF-8'.

        Details are as follows:

        In /j2-admin/WEB-INF/view/site/site-view.vm, there are many escape() calls, which does not support i18n. Instead of escape(), we can use encodeURI() or encodeURIComponent() function to encode unicode characters.
        See the following pages on this topic:

        So, I removed escape() calls in the page, and add escapeURIComponent() just before invoking AJAX calls.

        Also, I found that it worked properly only when the Tomcat connector's attribute, URIEncoding was set to 'UTF-8'. See the following example:

        <!-- 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" />

        About the above configuration, see the followings:

        Thanks.

        Show
        Woonsan Ko added a comment - I could reproduce this problem with Korean characters, too. As a summary, IMO, (1) site-view.vm should be patched with the attachment. (2) Tomcat connector's URIEncoding should be set to 'UTF-8'. Details are as follows: In /j2-admin/WEB-INF/view/site/site-view.vm, there are many escape() calls, which does not support i18n. Instead of escape(), we can use encodeURI() or encodeURIComponent() function to encode unicode characters. See the following pages on this topic: https://blueprints.dev.java.net/ajax-faq.html http://worldtimzone.com/blog/date/2002/09/24 http://weblogs.java.net/blog/gmurray71/archive/2006/03/ajax_i18n_with.html So, I removed escape() calls in the page, and add escapeURIComponent() just before invoking AJAX calls. Also, I found that it worked properly only when the Tomcat connector's attribute, URIEncoding was set to 'UTF-8'. See the following example: <!-- 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" /> About the above configuration, see the followings: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html Thanks.
        Hide
        Vitaly Baranovsky added a comment -

        Woonsan Ko, I've applied your patch. Now ukrainian symbols are saving successfully!
        Great thanks!

        Show
        Vitaly Baranovsky added a comment - Woonsan Ko, I've applied your patch. Now ukrainian symbols are saving successfully! Great thanks!
        Hide
        Woonsan Ko added a comment -

        Besides Portal Site Manager, Permissions Admin UI pages and Constraints Admin UI pages have escape() Javascript function calls to disable to use non-ascii characters for permission names and resource names.
        The function calls are replaced with encodeURIComponent().

        Show
        Woonsan Ko added a comment - Besides Portal Site Manager, Permissions Admin UI pages and Constraints Admin UI pages have escape() Javascript function calls to disable to use non-ascii characters for permission names and resource names. The function calls are replaced with encodeURIComponent().

          People

          • Assignee:
            Woonsan Ko
            Reporter:
            Vitaly Baranovsky
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development