Skip to content

Commit 1f83674

Browse files
authored
Merge pull request #599 from phil-davis/remove-utf8_encode-for-4.5
Remove utf8_encode
2 parents d1fdc0c + 167a599 commit 1f83674

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
15+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
1616
coverage: ['pcov']
1717
code-analysis: ['no']
1818
include:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
ChangeLog
22
=========
33

4+
4.5.1 (2022-10-09)
5+
------------------
6+
7+
* #597: Remove utf8_encode to easily support PHP 8.2 (@phil-davis)
8+
49
4.5.0 (2022-08-17)
510
------------------
611

lib/Parser/MimeDir.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,8 @@ protected function readProperty($line)
464464
switch (strtolower($charset)) {
465465
case 'utf-8':
466466
break;
467-
case 'iso-8859-1':
468-
$property['value'] = utf8_encode($property['value']);
469-
break;
470467
case 'windows-1252':
468+
case 'iso-8859-1':
471469
$property['value'] = mb_convert_encoding($property['value'], 'UTF-8', $charset);
472470
break;
473471
default:

lib/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ class Version
1414
/**
1515
* Full version number.
1616
*/
17-
const VERSION = '4.5.0';
17+
const VERSION = '4.5.1';
1818
}

tests/VObject/StringUtilTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ public function testUTF8ControlChar()
2929

3030
public function testConvertToUTF8nonUTF8()
3131
{
32-
$string = StringUtil::convertToUTF8(chr(0xbf));
32+
// 0xBF is an ASCII upside-down question mark
33+
$string = StringUtil::convertToUTF8(chr(0xBF));
3334

34-
$this->assertEquals(utf8_encode(chr(0xbf)), $string);
35+
$this->assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string);
3536
}
3637

3738
public function testConvertToUTF8IsUTF8()

0 commit comments

Comments
 (0)