On 25 March 2026 08:23:38 GMT, Robert Humphries <[email protected]> 
wrote:
>I think it would be useful if there were some examples of when you
>would want to be using `trim` but _not_ trim NULL bytes. The examples
>in the RFC currently show the expected change in behaviour; which is
>good - but you could also achieve the same effect by not running
>`trim` in the first place, as the only character in the examples that
>is expected to be removed before or after the change is the NULL byte
>(even in the example with a new line followed by null bytes, after the
>change then the string would be identical to before the `trim`).

I second this request, and would go further: the examples should show a 
situation where you *do* want to trim other "unusual" characters like "\v" and 
"\f".

The RFC talks about corrupting binary data, but wouldn't trimming *any* bytes 
from that data cause corruption? If you know the data is padded by a *specific* 
character, then passing that character to trim() explicitly is the *only* safe 
way to use it.


PS: Please can everyone remember to start your reply *below* the text you're 
replying to, and *trim* parts that are not directly relevant.


Rowan Tommins
[IMSoP]

Reply via email to