Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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