Skip to content

Commit a96f0a3

Browse files
committed
Tweak Text
Should be my last change here for a while.
1 parent 9408c1d commit a96f0a3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/PhpWord/Shared/Text.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public static function isUTF8($value = '')
144144
public static function toUTF8($value = '')
145145
{
146146
if (null !== $value && !self::isUTF8($value)) {
147-
// PHP8.2 : utf8_encode is deprecated, but mb_convert_encoding always usable
148147
$value = static::mbConvertEncoding($value);
149148
if ($value === false) {
150149
throw new WordException('Unable to convert text to UTF-8');
@@ -161,8 +160,7 @@ public static function toUTF8($value = '')
161160
*/
162161
protected static function mbConvertEncoding($value)
163162
{
164-
// PHP8.2 : utf8_encode is deprecated, but mb_convert_encoding always usable
165-
return (function_exists('mb_convert_encoding')) ? mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1') : utf8_encode($value);
163+
return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
166164
}
167165

168166
/**

0 commit comments

Comments
 (0)