Codesleuth/split-sms — pull request #9 by Codesleuth (2014-08-26 23:07:23+00:00)
Title: Allow specifying character set when splitting a message

This change allows a character set to be specified for a message, to force the splitter to pass the calculations through the specified character set splitter.

For Unicode, no much changed. For GSM, however, it was slightly more complicated since there are some substitutions required to enable GSM to work correctly.

All non-GSM characters are substituted for a space `'\u0020'` with this change, and all surrogate-pairs are substituted for a single space (rather than a space for each surrogate).

Usage is as follows:
```js
var splitter = require('split-sms');
var gsm = splitter.split(message, { characterset: 'GSM' });
var unicode = splitter.split(message, { characterset: 'Unicode' });
```

Omitting the option will default to the auto-detection behaviour. Invalid options are treated like they are Unicode right now - there are no plans to mitigate this.