child_process: validate encoding