instasent / sms-counter-php Goto Github PK
View Code? Open in Web Editor NEWSMS Counter and sanitize tools
License: MIT License
SMS Counter and sanitize tools
License: MIT License
Characters รฉ and ร are missing from the LATIN 1 charset.
Thanks for the awesome library!
Hi,
It seems that the utf8ToUnicode () function returns an unexpected result when there are more special utf8 characters in the string such as emojii.
Considering the following character: "๐" ( https://emojipedia.org/smiling-face-with-sunglasses/ )
When the function is called, passing a string containing a single emojii, it returns an array with a single integer value 2008.
When instead the string contains 2 emojii, the function returns an array containing 3 integer values: 2008, 944, 2008
Dont know how to delete it
When using this library with a dependency constraint in composer such as ^0.4.1
, newer versions such as 0.5.0
do not match this constraint (unlike a constraint such as ^1.4.1
and a version such as 1.5.1
which would match).
This is due to this rule in the semantic versioning spec:
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
So the question I have to the maintainer is: would you consider the public API of this library stable? Does the choice of the 0.* version numbers fit with the rule above? Or can the rule be safely ignored here?
SmsCounter@176
lacks $this->
:
$text = utf8ToUnicode($text);
Hi,
I am the original maintainer of sms-counter-php. After maintaining for some years, I had updated the readme in my repo with a cross link to the repo github.com/wooblecode/sms-counter-php.
The repo is now redirecting to this repo. Please confirm the change so that I can update the original repo with the meta link to this updated repo.
Regards,
It seems now that emoji are counted as 1 character when they occupy the space of 2 characters when encoded with UTF-16.
Given this statement:
$message = "๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐";
var_dump((new SMSCounter())->count($message));
This used to output:
{
+"encoding": "UTF16"
+"length": 139
+"per_message": 67
+"remaining": 62
+"messages": 3
}
but now outputs:
{
+"encoding": "UTF16"
+"length": 70
+"per_message": 70
+"remaining": 0
+"messages": 1
}
It would seem from my limited understanding of SMS character encoding that the former is correct.
Describe the bug
PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
(line 366 and 479).
sms-counter-php/SMSCounter.php
Line 366 in a0f017d
sms-counter-php/SMSCounter.php
Line 479 in a0f017d
To reproduce
Run the library on PHP8, then try to sanitize a value. You should have some deprecations.
(OPTIONAL) Additional context
composer install is failing on HHVM travis build
Fatal error: Uncaught Error: Keyword __HALT_COMPILER must be written in lowercase in /home/travis/.phpenv/versions/hhvm-stable/bin/composer:27
Composer dropped support for HHVM: composer/composer#8127
sms-counter-php/SMSCounter.php
Line 176 in 0b4f030
maybe $text = $this->utf8ToUnicode($text);
I am facing a very strange issue. When I pass the text via an ajax call, I get the count of the message as 1 sms but when the same text is submitted via a form, I get it as 2 sms count, The total length in first case it says 158 characters and on form submission it says 162 characters, The text is the following. I am really stuck in this and the whole system is stuck due to this. Any help is much appreciated
EID-UL-ADHA SPECIAL
FLAT 10% OFF on stitching and fabrics.
Place your order today at your nearest Dandy and get it before Eid.
03111132639
www.dandydesigns.pk
Sorry for the link the comment but thats part of the sms I am having problem with
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.