Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2690076
D25418.1734743445.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25418.1734743445.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 01:10 (16 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016706
Default Alt Text
D25418.1734743445.diff (1 KB)
Attached To
Mode
D25418: Catch RuntimeException: mb_convert_encoding(): Illegal character encoding specified at PhabricatorTextDocumentEngine.php:73
Attached
Detach File
Event Timeline
Log In to Comment