Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
add § and remove backslash to/from gsm_7bit_map
Browse files Browse the repository at this point in the history
  • Loading branch information
raychan committed Mar 7, 2017
1 parent fcd8546 commit d4696ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/SMSCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public static function int_gsm_7bit_map(){
return array(10,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,
51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,
71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
92,95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,
95,97,98,99,100,101,102,103,104,105,106,107,108,109,110,
111,112,113,114,115,116,117,118,119,120,121,122,
161,163,164,165,191,196,197,198,199,201,209,214,
161,163,164,165,167,191,196,197,198,199,201,209,214,
216,220,223,224,228,229,230,232,233,236,241,242,
246,248,249,252,915,916,920,923,926,928,931,934,
936,937);
Expand Down
18 changes: 15 additions & 3 deletions tests/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,22 @@ public function testIntMapIsComplete(){
}

public function testEachGSM(){
$character_set = SMSCounter::gsm_7bit_chars;
$len = strlen($character_set);
$character_set = ["@", "£", "\$", "¥", "è", "é", "ù", "ì", "ò", "Ç",
"\n", "Ø", "ø", "\r", "Å", "å", "Δ", "_", "Φ", "Γ",
"Λ", "Ω", "Π", "Ψ", "Σ", "Θ", "Ξ", "Æ", "æ", "ß",
"É", " ", "!", "\"", "#", "¤", "%", "&", "'", "(",
")", "*", "+", ",", "-", ".", "/", "0", "1", "2",
"3", "4", "5", "6", "7", "8", "9", ":", ";", "<",
"=", ">", "?", "¡", "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L", "M", "N", "O", "P",
"Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"Ä", "Ö", "Ñ", "Ü", "§", "¿", "a", "b", "c", "d",
"e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u", "v", "w", "x",
"y", "z", "ä", "ö", "ñ", "ü", "à", "\\"];
$len = count($character_set);
for($i = 0; $i< $len; $i++){
$this->assertEquals(SMSCounter::GSM_7BIT, SMSCounter::count($character_set[$i]."")->encoding, sprintf("Testing for character %s for GSM_7BIT", $character_set[$i].""));
$this->assertEquals(SMSCounter::GSM_7BIT, SMSCounter::count($character_set[$i])->encoding, sprintf("Testing for character %s for GSM_7BIT", $character_set[$i]));
}
$extra_character_set = array("|", "^", "{", "}", "[", "]", "~", "\\", "");
for($i = 0; $i< count($extra_character_set); $i++){
Expand Down

0 comments on commit d4696ff

Please sign in to comment.