Project

General

Profile

Actions

Defect #5251

closed

Git: Repository path encoding of non UTF-8 characters

Added by Markus Mälkönen about 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Low
Assignee:
Toshi MARUYAMA
Category:
SCM
Target version:
Start date:
2010-04-07
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed
Affected version:

Description

If filename include Scandinavian character, Redmine convert them another character. In this case, filename TEKIJÄT replaces string "TEKIJ\303\204T".


Files

git-filename-encoding-setting.png (29.9 KB) git-filename-encoding-setting.png Toshi MARUYAMA, 2010-06-08 00:40
Shift_JIS.png (52.9 KB) Shift_JIS.png Toshi MARUYAMA, 2011-03-09 10:50

Related issues

Related to Redmine - Defect #2664: Mercurial: Repository path encoding of non UTF-8 charactersClosedToshi MARUYAMA2009-02-04

Actions
Related to Redmine - Feature #3396: Git: use --encoding=UTF-8 in "git log"ClosedToshi MARUYAMA2009-05-20

Actions
Has duplicate Redmine - Defect #9107: Git: Redmine can't show Simplified Chinese character in filenames in git repositoryClosed2011-08-23

Actions
Actions #1

Updated by Toshi MARUYAMA almost 14 years ago

Try "git config --global core.quotepath false".

Actions #2

Updated by Toshi MARUYAMA almost 14 years ago

If your filename encoding is not UTF-8, try #2664 patches.

Actions #3

Updated by Felix Schäfer almost 14 years ago

I'd have told you to try to set RedmineSettings to whatever locale "scandinavian" is, but it seems it pertains only to file contents, not file names.

Actions #4

Updated by Toshi MARUYAMA almost 14 years ago

http://www.redmine.org/issues/2664#note-4

Mercurial (and also Git) treats file names as byte string.
Here we need to convert them to UTF-8,
but, there's no reliable info about file name encoding.

Actions #5

Updated by Toshi MARUYAMA about 13 years ago

  • Subject changed from Redmine can't show Scandinavian character in filenames in git repository to Git: Redmine can't show Scandinavian character in filenames in git repository
Actions #6

Updated by Toshi MARUYAMA about 13 years ago

I update a patch for Git at note-19 of #2664.

Actions #7

Updated by Toshi MARUYAMA about 13 years ago

  • Priority changed from Normal to Low

Ruby 1.9 compatibility is very serious.

Actions #8

Updated by Toshi MARUYAMA about 13 years ago

  • Subject changed from Git: Redmine can't show Scandinavian character in filenames in git repository to Git: Repository path encoding of non UTF-8 characters
  • Assignee set to Toshi MARUYAMA
Actions #9

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from New to Closed
  • Assignee deleted (Toshi MARUYAMA)
  • Resolution set to Wont fix

It is impossible to fix this issue in current git adapter scheme.
Please see r5027 comment.

Actions #10

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Toshi MARUYAMA
  • Resolution deleted (Wont fix)
Actions #11

Updated by Toshi MARUYAMA about 13 years ago

Toshi MARUYAMA wrote:

It is impossible to fix this issue in current git adapter scheme.
Please see r5027 comment.

$ git cat-file commit f85f88f507577dd2fa197db9e330875b2ea0757f
tree 887f4cf35a6ed3acd3bf72843b65884d8f637029
parent 57ca437c0acbbcb749821fdf3726a1367056d364
author jsmith <jsmith@foo.bar> 1285909440 -0500
committer jsmith <jsmith@foo.bar> 1285909440 -0500

copy latin-1 file.

--HG--
rename : latin-1-dir/test-?.txt => latin-1-dir/test-?-1.txt

$ git cat-file commit 67e7792ce20ccae2e4bb73eed09bb397819c8834 | iconv -f ISO-8859-1 -t UTF-8
tree 1ec7b464f0331a7d597ee2461ec58b3a0af11114
parent 7234cb2750b63f47bff735edc50a1c0a433c2518
author test latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ <test@example.com> 1285909200 -0500
committer test latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ <test@example.com> 1285909200 -0500
encoding ISO-8859-1

latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ

Git log is binary, and f85f88f507577d log is broken.

Actions #12

Updated by Toshi MARUYAMA about 13 years ago

  • % Done changed from 0 to 90
Actions #13

Updated by Jean-Philippe Lang about 13 years ago

r5049 broke all git tests with the git version currently used on the CI server (http://www.redmine.org/builds/index.html). The -c option was introduced in a recent git version (1.7.2). Is there any workaround for older versions?

Actions #14

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from Reopened to 7
  • Target version set to 1.2.0
Actions #15

Updated by Toshi MARUYAMA about 13 years ago

Jean-Philippe Lang wrote:

r5049 broke all git tests with the git version currently used on the CI server (http://www.redmine.org/builds/index.html). The -c option was introduced in a recent git version (1.7.2). Is there any workaround for older versions?

I fixed in r5068, r5069 and r5070.

Actions #16

Updated by Toshi MARUYAMA about 13 years ago

I finished implementing in r5072.

Limitation

  • Subversion supports URL encoding path and Redmine uses it.
    Mercurial adapter helper extension wraps path with URL encoding.
    Git adapter uses byte string to call "git" command.
    Because Ruby uses ANSI api to fork a process on Windows,
    it may have trouble in different locale on Windows.
  • Git adapter uses "-c core.quotepath=false" if git version is above 1.7.2
    at source:trunk/lib/redmine/scm/adapters/git_adapter.rb@5069#L342 .
    If your git is older than 1.7.2, you need to set "core.quotepath=false" in "config".
  • Japanese Shift_JIS and Traditional Chinese Big5 have 0x5c(backslash) problem.

Actions #17

Updated by Toshi MARUYAMA about 13 years ago

Toshi MARUYAMA wrote:

  • Subversion supports URL encoding path and Redmine uses it.
    Mercurial adapter helper extension wraps path with URL encoding.
    Git adapter uses byte string to call "git" command.
    Because Ruby uses ANSI api to fork a process on Windows,
    it may have trouble in different locale on Windows.

Related Ruby issue:
Bug 1771
system()/popen()/popen3() & windows & unicode is not working
http://redmine.ruby-lang.org/issues/show/1771

Actions

Also available in: Atom PDF