Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18083824
D21501.id51172.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
592 B
Referenced Files
None
Subscribers
None
D21501.id51172.diff
View Options
diff --git a/src/utils/utf8.php b/src/utils/utf8.php
--- a/src/utils/utf8.php
+++ b/src/utils/utf8.php
@@ -712,7 +712,16 @@
'mbstring'));
}
- $result = @mb_convert_encoding($string, $to_encoding, $from_encoding);
+ try {
+ $result = @mb_convert_encoding($string, $to_encoding, $from_encoding);
+ } catch (ValueError $ex) {
+ throw new Exception(
+ pht(
+ "String conversion from encoding '%s' to encoding '%s' failed: %s",
+ $from_encoding,
+ $to_encoding,
+ $ex));
+ }
if ($result === false) {
$message = error_get_last();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 6, 11:33 AM (2 d, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9025730
Default Alt Text
D21501.id51172.diff (592 B)
Attached To
Mode
D21501: Fix PhutilUTF8TestCase::testUTF8Convert for PHP 8
Attached
Detach File
Event Timeline
Log In to Comment