Page MenuHomePhorge

D25418.1726916178.diff
No OneTemporary

D25418.1726916178.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
Sat, Sep 21, 10:56 (20 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
893754
Default Alt Text
D25418.1726916178.diff (1 KB)

Event Timeline