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...
What is the "Content-type" header of the e-mail you get?