Page MenuHomePhabricator

Make Phabricator support non-Latin Diffusion URI and non-Latin filenames
Needs ReviewPublic

Authored by huangsj on Jan 2 2017, 1:35 AM.
Tags
None
Referenced Files
F13344546: D17128.diff
Fri, Jun 21, 8:02 AM
F13331833: D17128.diff
Mon, Jun 17, 8:12 AM
F13299496: D17128.diff
Fri, Jun 7, 8:04 AM
F13269371: D17128.diff
Wed, May 29, 6:14 AM
F13268729: D17128.diff
Wed, May 29, 5:19 AM
F13254301: D17128.diff
May 25 2024, 3:19 AM
F13234946: D17128.id41192.diff
May 21 2024, 4:00 AM
F13234892: D17128.id.diff
May 21 2024, 3:53 AM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Phabricator lacks support for non-latin repository URIs and non-latin filenames

When I create a new repository named 测试代码库1,the URI displayed in Details -> Clone is "ssh://myphabricator.com/diffusion/1/.git" while the expected one should be
"ssh://myphabricator.com/diffusion/1/测试代码库.git"

The incorrect URI is displayed becuase DiffusionRepositoryController.php uses csprintf('%R' to get displayURI and csprintf('%R' stripped all non-latin characters.

Also, as T11626: Phabricator should properly display non-English characters such as Chinese in diffusion commit page indicates, "读我文件.md" is displayed as "\350\257\273\346\210\221\346\226\207\344\273\266.md".

I find out that the cause of T11626: Phabricator should properly display non-English characters such as Chinese in diffusion commit page is lack of " -c core.quotepath=false " when running git command.
By default core.quotepath is true and git will convert "读我文件.md" to "\350\257\273\346\210\221\346\226\207\344\273\266.md"。

Test Plan

All non-latin characters are displayed properly without quote-escape and being stripped.

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Removing %R is dangerous.

Adding configuration flags to git is almost certainly not the best approach here.

I agree that I should not add 'core.quotepath=false' to git command.
If I do not want to quote path, I can configure this flag in my Linux installation instead.

And yes, I find out that I do not need to remove %R to make Phabricator support displaying non ascii Diffusion URIs