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
Sat, Dec 21, 5:55 AM (17 h, 23 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6912957
Default Alt Text
D9780.diff (1 KB)

Event Timeline