Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-5124

multi-byte language utf-8 encode and calendar datepicker problem analyze and resolve

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Medium
    • None
    • None
    • None
    • windows 2000 server,tomcat 5.0.28 ,use UTF-8,locale zh_CN

    Description

      The Jira use "JsCalendar" from http://sourceforge.net/projects/jscalendar/.

      and in jira directory jira\secure\popups\calendar.jsp have one statement:

       
      <script type="text/javascript" 
      src="<%= request.getContextPath() %>/includes/js/lang/calendar-<webwork:property value="./language"/>.js">
      </script>
      

      and in Calendar.java have some statements:

       
      	public String getLanguage()
      		throws IOException
      	{
      		String language = getLocale().getLanguage();
      		if(isSupportedLanguage(language))
      			return language;
      		else
      			return "en";
      	}
      

      From above context,we can know,the jira load the calendar javascript by language.

      But we all know,the "Character Encoding" and "Locale" (user locale or default locale) is very different.

      for example,we set "Character Encoding" to UTF-8, and set locale to english,it is no problem when you use datepicker,because the "UTF-8" include "english ascii char", also support other single-byte language. but if we set the locale to "Multi-byte Language", like chinese,russian ,the error occured. because the calendar javascript is encoded in chinese or russian, but not encoding in UTF-8,so the internet exploer load the javascript file error,we can't use the datepicker at this time.

      How to resolve ???
      (at this time ,we always use utf-8 to support multiple language,so we use utf-8 as my encoding to support multiple language. in future ,we may use other encoding.)
      The way is: if encoding is utf-8,load the javascript by language and encoding .
      if the encoding is not utf-8,load the javascript by language.

      ( because if not multiple language support ,not use utf-8, for example use iso-8859-1,it is not support other multi-byte language,so we can't use other locale to use jira)

      so,we modify Calendar.java method getLanguage().

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ea3fddd8b40e scud
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: