Skip to content

Commit a031483

Browse files
Starfox64Starfox64
andauthored
Fix C with Cedilla GSM code point (#318)
* Fix C with Cedilla GSM code point EncodingDetector incorrectly uses the lowercase version of `Latin Small Letter C with Cedilla (U+00E7)` instead of `Latin Capital Letter C with Cedilla (U+00C7)`. See https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38 * Fix Tests for French C cedillia * Fix frenchWithOnlyGSM test characters Co-authored-by: Starfox64 <louisdijon21@yahoo.fr>
1 parent 392e68f commit a031483

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Message/EncodingDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function requiresUnicodeEncoding($content): bool
2929
$gsmCodePoints = array_map(
3030
$this->convertIntoUnicode(),
3131
[
32-
'@', '£', '$', '¥', 'è', 'é', 'ù', 'ì', 'ò', 'ç', "\r", 'Ø', 'ø', "\n", 'Å', 'å',
32+
'@', '£', '$', '¥', 'è', 'é', 'ù', 'ì', 'ò', 'Ç', "\r", 'Ø', 'ø', "\n", 'Å', 'å',
3333
'Δ', '_', 'Φ', 'Γ', 'Λ', 'Ω', 'Π', 'Ψ', 'Σ', 'Θ', 'Ξ', 'Æ', 'æ', 'ß', 'É',
3434
' ', '!', '"', '#', '¤', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
3535
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',

test/Message/EncodingDetectorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ public function unicodeProvider(): array
4949
'près du mälström où brûlent les novæ.',
5050
true
5151
];
52-
$r['frenchWithOnlyGSM'] = [
52+
$r['frenchWithUnicode2'] = [
5353
'j\'étais donc plein de songes ! L\'espérance en chantant me berçait de mensonges. J\'étais ' .
5454
'donc cet enfant, hélas !',
55+
true
56+
];
57+
$r['frenchWithOnlyGSM'] = [
58+
'Le progrès est le moteur de la science ; l\'idéal est le générateur de l\'art.',
5559
false
5660
];
5761
$r['icelandic'] = ['Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa ', true];

0 commit comments

Comments
 (0)