Page MenuHomePhabricator

File xsprintf.php should set locale explicitly to support non-latin filenames in repository
Needs ReviewPublic

Authored by huangsj on Jan 2 2017, 1:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 22 2024, 4:59 PM
Unknown Object (File)
Nov 18 2024, 5:32 AM
Unknown Object (File)
Nov 14 2024, 7:41 AM
Unknown Object (File)
Nov 13 2024, 6:45 AM
Unknown Object (File)
Nov 10 2024, 8:32 AM
Unknown Object (File)
Nov 6 2024, 11:13 AM
Unknown Object (File)
Oct 14 2024, 4:08 PM
Unknown Object (File)
Sep 2 2024, 9:24 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

When I fixed T11626: Phabricator should properly display non-English characters such as Chinese in diffusion commit page, I discovered that although filenames are displayed correctly as described in T11626, I still could not view its content.

I created a file "读我文件.md" with its content "读我的内容" in repository "R1:测试代码库1".
when I browsed a specific commit, say "b863740eab66", I could not view file content, Phabricator kept saying "Loading".

pasted_file (1×2 px, 313 KB)

pasted_file (696×1 px, 52 KB)

If I apply this patch, the file content will display.

pasted_file (714×1 px, 61 KB)

Test Plan

1 Create a repository 测试代码库1 and add 1 file "读我文件.md" with its content "读我的内容" to this repository.
2 Browse this repository and navigate to a specific commit when "读我文件.md" is added.

pasted_file (1×2 px, 313 KB)

3 Click "读我文件.md" and the following should display.

pasted_file (714×1 px, 61 KB)

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

huangsj edited the test plan for this revision. (Show Details)

Please file a task describing exactly what the issue is. Executing a global setlocale() as a side effect is certainly not the best solution.

You're right.
Explicitly setlocale globally is not the best.

I think what I should do is to set environment variable LANG to something like zh-CN.UTF-8 in my Linux machine to support Chinese filenames.