in the mbstring case you use `rtrim`  in the other case not?