[ 
https://issues.jenkins-ci.org/browse/JENKINS-7997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163016#comment-163016
 ] 

Diptiman Adak commented on JENKINS-7997:
----------------------------------------

I want to add some more information for this issue.I have added some Chinese 
text in the Global configuration page in the in the   Default Content 
textbox.Those Chinese characters are displaying properly.But if I added any 
Chinese characters inside the jelly script that character is not displaying 
properly.

Another important thing is that other strings in the Jelly Script is displaying 
in Chinese

<TR><TD>Build URL</TD><TD><A 
href="${rooturl}${build.url}">${rooturl}${build.url}</TD></TR>
   <TR><TD>Project:</TD><TD>${project.name}</TD></TR>
  <TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
  <TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>

Except ${build.durationString} all other strings are displaying in English in 
mail whether the other characters are displaying properly in Jenkins page.
Now I have modified the JellyScriptContent.java
 This function I have modified to add utf-8 encoding....
private String renderContent(AbstractBuild<?, ?> build, InputStream inputStream)
            throws JellyException, IOException {
        JellyContext context = createContext(new 
ScriptContentBuildWrapper(build), build);
       
        Reader reader = new InputStreamReader(inputStream,"UTF-8");
        InputSource input = new InputSource(reader);
        input.setEncoding("UTF-8");
       
        Script script = context.compileScript(input);
        if (script != null) {
            return convert(context, script);
        }
        return null;
    }

But nothing is working.I am not able to set the UTF-8 for jelly script.In jelly 
script i tried with
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>  

Slide has pointed out to set the content type...It is set as html....Now I dont 
know anything more we need to do except that or not..Today I have tested with 
all the Jelly scripts that is in the email ext plugins and same problem is 
there...Only the build.durationstring is not coming in Chinese which not 
proper...For groovy I am not sure , Tomorrow I will check with groovy...


                
> Changelog read from JellyScript
> -------------------------------
>
>                 Key: JENKINS-7997
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-7997
>             Project: Jenkins
>          Issue Type: Bug
>          Components: email-ext
>    Affects Versions: current
>         Environment: WindowsXP
>            Reporter: ttaqt
>            Priority: Critical
>
> Use the Jelly Script Template from version 2.9. I found that if SVN Checkin 
> log has Chinese. It will show the Chinese as (鏇挎崲鍐欏箍鎾姛鑳藉尯鐨勮创鍥惧苟淇敼鍔ㄧ敾鐨勫疄鐜� . 
> Is it the Jelly Script doesn`t support UTF-8?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to