Page MenuHomePhabricator

D9780.diff
No OneTemporary

D9780.diff

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

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)

Event Timeline