encoding notes

This commit is contained in:
Evgeny @ SimpleX Chat
2026-03-11 09:47:18 +00:00
parent e5dbe97e1d
commit 7ece87f1b6
2 changed files with 9 additions and 2 deletions
@@ -36,6 +36,10 @@ Sequential concatenation with no separators. Works because each element's encodi
Only seconds are encoded (as Int64); nanoseconds are discarded on encode and set to 0 on decode.
## String instance
`smpEncode` goes through `B.pack`, which silently truncates any Unicode character above codepoint 255 to its lowest byte. A String containing non-Latin-1 characters is silently corrupted on encode with no error. Same issue exists in the `StrEncoding String` instance — see [Simplex.Messaging.Encoding.String](./Encoding/String.md#string-instance).
## smpEncodeList / smpListP
1-byte length prefix for lists — same 255-item limit as ByteString's 255-byte limit.