Declare the alphabet a GSM message is actually written in (#100)

* Regression tests for the alphabet a GSM message declares

* Declare the alphabet a GSM message is actually written in

* Reflow the composing-by-hand paragraph

* Drop the ASCII alias SMPP's flat table shares with the option's own

* Bound the receipt test's wait and tighten the notes around it
This commit is contained in:
2026-09-09 21:30:55 +02:00
committed by GitHub
parent 989eb01763
commit ca1a7473ed
15 changed files with 275 additions and 33 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import type { Result } from './result.ts';
import type { EncodingName } from './defs/encodings.ts';
import { detect, encodingByDataCoding, encodings, unencodable, unencodableText } from './defs/encodings.ts';
import { consts, hasUdh } from './defs/constants.ts';
import { dataCodingByEncoding, detect, encodingByDataCoding, encodings, unencodable, unencodableText } from './defs/encodings.ts';
import { hasUdh } from './defs/constants.ts';
import { udhLength } from './udh.ts';
/** A single SMS carries 1120 bits, whatever the alphabet. */
@@ -35,7 +35,7 @@ export function encodeBody(
if (dataCoding === undefined) {
const detected = encodeMessage(text);
return { buffer: detected.buffer, dataCoding: consts.ENCODING[detected.encoding] };
return { buffer: detected.buffer, dataCoding: dataCodingByEncoding[detected.encoding] };
}
const encoding = encodingByDataCoding(dataCoding);