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

add § and remove backslash to/from gsm_7bit_map #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = array("@", "£", "\$", "¥", "è", "é", "ù", "ì", "ò", "Ç",
"\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