Page MenuHomePhorge

D25418.1726911277.diff
No OneTemporary

D25418.1726911277.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,18 @@
$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) {
+ $message = $ex->getMessage();
+ phlog(pht('Error converting encoding %s to UTF8 for document %s: %s',
+ $encoding,
+ $ref->getName(),
+ $message));
+ }
} else {
$this->encodingMessage = pht(
'Unable to perform text encoding conversion: mbstring extension '.

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 21, 09:34 (18 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
893739
Default Alt Text
D25418.1726911277.diff (1 KB)

Event Timeline