@@ -22,10 +22,10 @@ def _get_gsm_7bit_map(cls):
22
22
46 , 47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 ,
23
23
63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 ,
24
24
80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 , 92 , 95 , 97 , 98 , 99 ,
25
- 100 , 101 , 102 , 103 , 104 , 105 , 106 , 107 , 108 , 109 , 110 , 111 , 112 ,
26
- 113 , 114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 , 122 , 161 , 163 , 164 ,
27
- 165 , 191 , 196 , 197 , 198 , 199 , 201 , 209 , 214 , 216 , 220 , 223 , 224 ,
28
- 228 , 229 , 230 , 232 , 233 , 236 , 241 , 242 , 246 , 248 , 249 , 252 , 915 ,
25
+ 100 , 101 , 102 , 103 , 104 , 105 , 106 , 107 , 108 , 109 , 110 , 111 , 112 ,
26
+ 113 , 114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 , 122 , 161 , 163 , 164 ,
27
+ 165 , 191 , 196 , 197 , 198 , 199 , 201 , 209 , 214 , 216 , 220 , 223 , 224 ,
28
+ 228 , 229 , 230 , 232 , 233 , 236 , 241 , 242 , 246 , 248 , 249 , 252 , 915 ,
29
29
916 , 920 , 923 , 926 , 928 , 931 , 934 , 936 , 937 ]
30
30
return gsm_7bit_map
31
31
@@ -84,7 +84,11 @@ def count(cls, plaintext):
84
84
# and then convert the ceil result to int
85
85
# since python 2.7 return a float
86
86
messages = int (ceil (length / float (permessage )))
87
- remaining = (permessage * messages ) - length
87
+
88
+ if length == 0 :
89
+ remaining = permessage
90
+ else :
91
+ remaining = (permessage * messages ) - length
88
92
89
93
returnset = {
90
94
'encoding' : encoding ,
0 commit comments