Differences between revisions 1 and 2
Revision 1 as of 2020-247 19:53:29
Size: 693
Editor: CPEf81d0f884ab3-CMf81d0f884ab0
Comment: write draft of the base10 encoding
Revision 2 as of 2020-247 19:53:39
Size: 703
Editor: CPEf81d0f884ab3-CMf81d0f884ab0
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
{{{
Line 14: Line 15:
}}}

Some SIP forwarders and clients are very limited and/or broken to only allow ASCII 0-9 in the SIP URI username. So, it is useful to have an encoding for all text into only ASCII 0-9 in as few resulting charatcters as possible in the average case.

Full ASCII goes to 127, so it takes three digits to encode each point. However if we subtract 31 to remove the nonprinting space at the front of ASCII then we get all points that fit within two digits.

The encoding:

bytes = text encoded in utf8

if all (byte - 30 < 99) then
    concat of each byte { base 10 encode of (byte - 30), two digits each }
else
    "00" + concat of each byte { base 10 encode, three digits each }
end

TextEncodingBase10 (last edited 2020-250 23:57:34 by d50-92-76-47)