Skip to content

Can't access remote repository if the URL contains Chinese word #945

Closed
@YueLinHo

Description

@YueLinHo
  • [v] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

64 bit

$ git --version --build-options
git version 2.10.2.windows.1
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [版本 6.1.7601]

Win7 64 Pro

  • What options did you set as part of the installation? Or did you choose the defaults?
> type "C:\Program Files\Git\etc\install-options.txt"
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related to the issue you're seeing?

Suppose 2.10.1 has the same issue.

Study some, and compare the changes between 2.10.0 and 2.10.1, then I guess the changes of url.c in
commit introduce hex2chr() for converting two hexadecimal digits to a character may be the key?

Also see TortoiseGit issue 2859

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD

Can't clone if URL contains Chinese word(s)

$ git.exe clone --progress -v "D:\Temp\i2859\Test中文.git" "D:\Temp\i2859\Test中文2.10.2"

Or add a remote and its URL contains Chinese word(s). Then can't perform fetch/push anymore.

Note: English URL works fine.

  • What did you expect to occur after running these commands?

Like Git Bash does:

$ git.exe clone --progress -v "D:\Temp\i2859\Test中文.git" "D:\Temp\i2859\Test中文2.10.2"
Cloning into 'D:\Temp\i2859\Test中文2.10.2'...
done.
  • What actually happened instead?
D:\Temp\i2589>git.exe clone --progress -v "D:\Temp\i2589\Test中文.git" "D:\Temp\i2589\Test中文2.10.2"
Cloning into 'D:\Temp\i2589\Test中文2.10.2'...
"git-upload-pack 'D:\Temp\i2589\Test中�.git'": git-upload-pack 'D:\Temp\i2589\Test中�.git': No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Warning: Your console font probably doesn't support Unicode. If you experience strange characters in the output, consider switching to a TrueType font such as Consolas!

default

Update 1

TortoiseGit interface shows those two strings normally:

image

And test with true type in cmd.exe:

D:\Temp\i2589>git clone "D:\Temp\i2859\Test中文.git" "D:\Temp\i2859\中文2.10.2"
Cloning into 'D:\Temp\i2859\中文2.10.2'...
"git-upload-pack 'D:\Temp\i2859\Test中�.git'": git-upload-pack 'D:\Temp\i2859
\Test中�.git': No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

image

That warning is gone.

Update 2

Other testing results: (TortoiseGit calls git.exe)

tests

As you can see:

  1. 2.10.0 is last good for TortoiseGit
  2. 2.10.1 is first bad. Bash works fine, but CMD. (based on that TortoiseGit calls git.exe, and the result in my last comment)

Workaround

call set LC_ALL=C in cmd.exe

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions