Skip to content

Commit 685610f

Browse files
committed
Covert license content to utf8
1 parent 99714b2 commit 685610f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"require": {
1313
"php": ">=8.3",
1414
"ext-dom": "*",
15+
"ext-mbstring": "*",
1516
"ext-yaml": "*",
1617
"league/html-to-markdown": "^5.1"
1718
},

composer.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/License/Text/LicenseText.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@
3333
use Aternos\Licensee\TextTransformer\StripUrlTransformer;
3434
use Aternos\Licensee\TextTransformer\StripVersionTransformer;
3535
use Aternos\Licensee\TextTransformer\StripWhitespaceTransformer;
36+
use Aternos\Licensee\TextTransformer\TextTransformer;
3637

3738
class LicenseText
3839
{
40+
/**
41+
* @var TextTransformer[]
42+
*/
3943
protected array $transformers;
4044
protected ?string $normalizedContent = null;
4145
protected ?array $wordSet = null;
@@ -101,7 +105,7 @@ public function __construct(
101105
public function getNormalizedContent(): string
102106
{
103107
if ($this->normalizedContent === null) {
104-
$this->normalizedContent = $this->content;
108+
$this->normalizedContent = mb_convert_encoding($this->content, 'utf8');
105109
foreach ($this->transformers as $transformer) {
106110
$this->normalizedContent = $transformer->transform($this->normalizedContent);
107111
$this->normalizedContent = RegExpException::handleNull(preg_replace("# +#", " ", $this->normalizedContent));

0 commit comments

Comments
 (0)