apache / apache/maven-scm

[SCM-897] French accent lost and replaced by weird characters in the changelog.xml

Open
#1,118 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
104
Forks
189
Avg merge
17h 46m
Merged PRs (30d)
6

Description

**[Jamel](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=aljane.jamel@gmail.com)** opened **[SCM-897](https://issues.apache.org/jira/browse/SCM-897?redirect=false)** and commented

Executing changelog goal of maven-changelog-plugin will result in xml file with weird characters replacing french accented characters.

You have to execute maven command on french system (in my case windows 7) to get the problem.

So far, I realized that a bug may be present in the scm git-exe plugin. it seems that an UTF-8 stream was read as ISO-8859-1 (Westen Europe) which lead to corrupted message.

I fixed the bug by passing System.getProperty("file.encoding") to --encoding param of "git whatchanged" command.

```
I added this line of code:
cl.createArg().setValue( "--encoding=" + System.getProperty("file.encoding"));
to org.apache.maven.scm.provider.git.gitexe.command.changelog.GitChangeLogCommand.createCommandLine()
```

the other way is to read the command output with the right encoding (I assume UTF-8).

---

**Affects:** 1.9.4

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in org.apache.maven.scm.provider.git.gitexe.command.changelog.GitChangeLogCommand.createCommandLine() and reproduce the changelog goal on a French Windows system. Compare the encoding used by git whatchanged with the generated changelog.xml; done means French accented characters are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.