Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/u-mulder/sms-charset-detector
Detecting sms charset according to gsm charset gsm03.38
https://github.com/u-mulder/sms-charset-detector
gsm gsm-charset gsm0338 sms ucs
Last synced: about 5 hours ago
JSON representation
Detecting sms charset according to gsm charset gsm03.38
- Host: GitHub
- URL: https://github.com/u-mulder/sms-charset-detector
- Owner: u-mulder
- Created: 2020-12-13T18:18:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T18:06:16.000Z (almost 4 years ago)
- Last Synced: 2024-07-21T05:47:30.139Z (4 months ago)
- Topics: gsm, gsm-charset, gsm0338, sms, ucs
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sms-charset-detector
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/u-mulder/sms_charset_detector/base-test-suite?style=flat-square)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/u-mulder/sms-charset-detector?sort=semver&style=flat-square)Detecting sms charset using [gsm charset](https://en.wikipedia.org/wiki/GSM_03.38).
sms-charset-detector helps you to detect whether your sms content contains gsm charset symbols only or not.
## Installation
Install package with [Composer](https://getcomposer.org/):
```
> composer require um/sms-charset-detector
```## Usage
Simple usage:
```php
use Um\CharsetDetector\BasicCharsetDetector;$detector = new BasicCharsetDetector();
$message = 'Some message to be sent over sms';$encoding = $detector->detectCharset($message);
echo $encoding; // outputs either 'gsm' or 'ucs'// simple check if charset is 'gsm'
$messageHasGsmCharset = $detector->isGsmCharset($message);
var_dump($messageHasGsmCharset); // outputs either `true` or `false`
```