[core] Make message splitting work with unicode strings too