Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by 80df2135e903bc167b70cd1a45e8d4eb803e87ed.