Page MenuHomePhabricator

differential final diff shows "This file uses an unknown character encoding"
Closed, ResolvedPublic

Description

I got a problem is that I created a diff with arc on windows ,used the command "arc diff . --encoding GBK",then the differential was accepted by reviewer,it shows pretty normal.But, i used "arc commit -- revison Dxxx" to commit the changes.The differential's final diff shows "This file uses an unknow character encoding".
my environment is :
arc on windows 7 x64,
server os :redhat6.3 x64 or sles 10(i586)
php version:v2.3.0
apache/2.2.15

Event Timeline

clark.woo.12 claimed this task.
clark.woo.12 raised the priority of this task from to Needs Triage.
clark.woo.12 updated the task description. (Show Details)
clark.woo.12 added a project: Differential.

chad removed epriestley as the assignee of this task.Feb 3 2015, 4:14 AM
chad removed a subscriber: epriestley.

I think this problem is that:I used to write my code in eclipse,the workspace properties "Text file encoding" was seted as "GBK".
I seted "Diffusion"->"Edit Repository"->"Text Encoding","GBK",my code shows normal in Diffusion,but it shows abnormal in Differential's final diff.
Maybe,i need convert the code to "GBK" in Differential's final diff.

clark.woo.12 added a comment.EditedFeb 12 2015, 9:57 AM

Partially resolved,I changed line197 in PhabricatorLiskDAO.php.I added "EUC-CN"(php 5.3.3) in the first place in "try_encodings" array.
When the daemon generateFinalDiff,it converted the data from "GBK" to “UTF-8”.
line 180:phutil_is_utf8($string) ? 'utf8' : null;
changed to
line 180:phutil_is_utf8($string) ? 'utf8' : 'gbk';

clark.woo.12 closed this task as Resolved.Feb 13 2015, 12:08 AM
clark.woo.12 claimed this task.
clark.woo.12 renamed this task from differential final diff shows "This file uses an unknow character encoding" to differential final diff shows "This file uses an unknown character encoding".Nov 8 2015, 11:57 AM