Subprocess encoding fixes for cpp extension (#63756)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/63584
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63756
Reviewed By: bdhirsh
Differential Revision: D30485046
Pulled By: ezyang
fbshipit-source-id: 4f0ac383da4e8843e2a602dceae85f389d7434ee