Fix UnicodeDecodeError in protoc_wrapper.py on non-English Windows

`RewriteImports()` opens generated .ts files without specifying an
encoding. On Windows systems with non-UTF-8 default locale (e.g.
Chinese/GBK), this causes a UnicodeDecodeError because Python
defaults to the system encoding.

Explicitly specify encoding='utf-8' since protoc always generates
UTF-8 files.

Bug: none
Change-Id: I09a5ecdea2864c4d593c38cc365e42d3d9d0720d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7879961
Reviewed-by: Sophie Chang <sophiechang@chromium.org>
Commit-Queue: Wang, Wei4 <wei4.wang@intel.com>
Cr-Commit-Position: refs/heads/main@{#1638240}
NOKEYCHECK=True
GitOrigin-RevId: 777b8759f78d8c4e0d0d292cb3e8777aae02e3e5
1 file changed