Page MenuHomePhorge

D25418.1734731603.diff
No OneTemporary

D25418.1734731603.diff

diff --git a/src/applications/files/document/PhabricatorTextDocumentEngine.php b/src/applications/files/document/PhabricatorTextDocumentEngine.php
--- a/src/applications/files/document/PhabricatorTextDocumentEngine.php
+++ b/src/applications/files/document/PhabricatorTextDocumentEngine.php
@@ -70,10 +70,16 @@
$encoding = $this->getEncodingConfiguration();
if ($encoding !== null) {
if (function_exists('mb_convert_encoding')) {
- $content = mb_convert_encoding($content, 'UTF-8', $encoding);
- $this->encodingMessage = pht(
- 'This document was converted from %s to UTF8 for display.',
- $encoding);
+ try {
+ $content = mb_convert_encoding($content, 'UTF-8', $encoding);
+ $this->encodingMessage = pht(
+ 'This document was converted from %s to UTF8 for display.',
+ $encoding);
+ } catch (Throwable $ex) {
+ $this->encodingMessage = pht(
+ 'Unable to convert from requested encoding %s to UTF8.',
+ $encoding);
+ }
} else {
$this->encodingMessage = pht(
'Unable to perform text encoding conversion: mbstring extension '.

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 21:53 (12 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016706
Default Alt Text
D25418.1734731603.diff (1 KB)

Event Timeline