You are not logged in.
Pages: 1
While reading log files using Rust, I discover what some of them is not a UTF8 text. This happens in case we truncate a long strings using `TextTruncateAtLength` parameter, and writer break a string inside a surrogate pair (in my case I logs an input JSON what contains a non latin strings).
IMHO good place is to fix this inside a logger here https://github.com/synopse/mORMot2/blob … .pas#L5531 (not inside writer for compatibility). Good solution is to tries step forward a little (for max of 3 char, because string can be actual a binary) and found actual character end.
Or I should fix this on my app level?
Last edited by mpv (2023-10-02 10:01:28)
Offline
We already have function for this purpose: Utf8TruncatedLength.
Offline
Perhaps https://github.com/synopse/mORMot2/commit/ebb54974 could help.
Offline
Thanks! I back-port it to mORMot1 - see https://github.com/synopse/mORMot/pull/446
Offline
Pages: 1