Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d11407d

Browse filesBrowse files
bug #53588 [Translation] fix multi-byte code area to convert (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Translation] fix multi-byte code area to convert | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT While debugging #47783 I stumbled upon tijsverkoyen/CssToInlineStyles#237 which made me realise that we suffer from the same issue in `PseudoLocalizationTranslator`. So I decided to apply the patch from tijsverkoyen/CssToInlineStyles#238 here. Commits ------- 2eadd39 fix multi-byte code area to convert
2 parents f3cf7e0 + 2eadd39 commit d11407d
Copy full SHA for d11407d

File tree

2 files changed

+2
-1
lines changed
Filter options

2 files changed

+2
-1
lines changed

‎src/Symfony/Component/Translation/PseudoLocalizationTranslator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/PseudoLocalizationTranslator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function getParts(string $originalTrans): array
123123
return [[true, true, $originalTrans]];
124124
}
125125

126-
$html = mb_encode_numericentity($originalTrans, [0x80, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8');
126+
$html = mb_encode_numericentity($originalTrans, [0x80, 0x10FFFF, 0, 0x1FFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8');
127127

128128
$useInternalErrors = libxml_use_internal_errors(true);
129129

‎src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public static function provideTrans(): array
4444
['<p data-foo="ccc&quot;&quot;">ƀåŕ</p>', '<p data-foo="ccc&quot;&quot;">bar</p>', self::getIsolatedOptions(['parse_html' => true, 'accents' => true])],
4545
['<p>″≤″</p>', '<p>&quot;&lt;&quot;</p>', self::getIsolatedOptions(['parse_html' => true, 'accents' => true])],
4646
['Symfony is an Open Source, community-driven project with thousands of contributors. ~~~~~~~ ~~ ~~~~ ~~~~~~~ ~~~~~~~ ~~ ~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~ ~~ ~~~', 'Symfony is an Open Source, community-driven project with thousands of contributors.', self::getIsolatedOptions(['expansion_factor' => 2.0])],
47+
['<p>👇👇👇👇👇👇👇</p>', '<p>👇👇👇👇👇👇👇</p>', self::getIsolatedOptions(['parse_html' => true])],
4748
];
4849
}
4950

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.