Add encoding to open calls in tools

When opening a text file it is important to specify encoding='utf-8'
since otherwise the behavior will depend on your system locale. This
change fixes all the encoding omissions I could find in the tools
directory, found by running "git cl presubmit --all" with
crrev.com/c/4290775 patched in.

Bug: 1418846
Change-Id: Ie4478ff9b3e3814e6396a5b0c3c0e9c273202838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295846
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111897}
NOKEYCHECK=True
GitOrigin-RevId: a9e1d9f7f511dc59fe23f49fab55f3a18a15c1a5
1 file changed