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: 4 months 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 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T18:06:16.000Z (over 4 years ago)
- Last Synced: 2025-06-01T03:18:22.112Z (4 months ago)
- Topics: gsm, gsm-charset, gsm0338, sms, ucs
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sms-charset-detector

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`
```