Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14046744
D9780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9780.diff
View Options
diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
--- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
@@ -252,15 +252,22 @@
break;
}
- $encoding = $this->getOriginalCharacterEncoding();
- if ($encoding != 'utf8' && ($file == DifferentialChangeType::FILE_TEXT)) {
- if ($encoding) {
- $messages[] = pht(
- 'This file was converted from %s for display.',
- phutil_tag('strong', array(), $encoding));
- } else {
- $messages[] = pht(
- 'This file uses an unknown character encoding.');
+ // If this is a text file with at least one hunk, we may have converted
+ // the text encoding. In this case, show a note.
+ $show_encoding = ($file == DifferentialChangeType::FILE_TEXT) &&
+ ($changeset->getHunks());
+
+ if ($show_encoding) {
+ $encoding = $this->getOriginalCharacterEncoding();
+ if ($encoding != 'utf8') {
+ if ($encoding) {
+ $messages[] = pht(
+ 'This file was converted from %s for display.',
+ phutil_tag('strong', array(), $encoding));
+ } else {
+ $messages[] = pht(
+ 'This file uses an unknown character encoding.');
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 11:32 PM (4 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730276
Default Alt Text
D9780.diff (1 KB)
Attached To
Mode
D9780: Only show text encoding note in Differential if a change has hunks
Attached
Detach File
Event Timeline
Log In to Comment