7

We have Perforce for source control and Jenkins for Continuous Integration. They are integrated using JENKINS Perforce Plugin. Eclipse IDE with P4Eclipse (the Perforce Plug-in for Eclipse) for developing/committing.

There problem is that changes comments (usually wrote in Chinese) get spoiled. (Sources with Chinese comments are compiled without this problem.)

What is the reason? How to fix?

Where Perforce Server and JENKINS plugin encoding is set?

Change comments are spoiled

UPDATE August 2014

While browsing /jenkins/systemInfo page of Jenkins I noticed that property file.encoding had value CP1252 (see Windows-1252) as that Jenkins was running on Windows. Because that properties are actually properties of Tomcat, we set up UTF-8 using one of option inside Change Tomcat's Charset.defaultCharset in windows . After Tomcat restart we got file.encoding UTF8, but it did not solved the problem.

Once again, Sources are in UTF-8 and they have no problem after arriving on Jenkins server. It is about commits comments.

UPDATE 2:

It is not browser related as comments within Java code are shown correctly.
We took closer look and found that Jenkins stores changes comments in xml file per every job. And in that file encoding is already spoiled.

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • What OS/default encoding are the perforce client, the perforce server, and Jenkins? – flup Jan 24 '13 at 07:37
  • And is it only Jenkins where the comments appear garbled? Can you read them from command line client? – flup Jan 24 '13 at 07:39
  • [Importance of setting a character encoding in Perforce](http://kb.perforce.com/article/1406/importance-of-setting-a-character-encoding-in-perforce) says here the metadata is always utf-8 if the server is Unicode enabled. Is it? – flup Jan 24 '13 at 07:42
  • Server is not Unicode enabled. It is all OK in Eclipse, Perforce rich client. And I have just checked command line client (with command p4 changelists). It is also OK. Problem happens between Perforce server and Jenkins. – Paul Verest Jan 31 '13 at 03:27
  • How about the clientspec the Jenkins server uses? Can you specify encoding settings there? – flup Jan 31 '13 at 11:36
  • I have checked https://wiki.jenkins-ci.org/display/JENKINS/Perforce+Plugin . There's no way to set encoding. (And once again, problem is only with change descriptions) – Paul Verest Feb 07 '13 at 08:44
  • From that page, 1b and 1c: `Create a workspace (clientspec) for the plugin to use. Name it "jenkins-jobname" or something. Ensure that the workspace matches your development settings for your project (e.g., LineEnd, Options, etc.)` Does this clientspec have encoding settings perhaps? – flup Feb 07 '13 at 16:51

1 Answers1

2

Have you tried changing the page-encoding on the browser itself?

Depends on the browser, but on Firefox, you would click View -> Character Encoding -> Chinese

Slav
  • 27,057
  • 11
  • 80
  • 104