api: force encoding to UTF-8

This commit is contained in:
Bo Anderson 2025-05-01 07:25:18 +01:00
parent d8b96a4385
commit 4c19e11abe
No known key found for this signature in database

View File

@ -96,7 +96,7 @@ module Homebrew
mtime = insecure_download ? Time.new(1970, 1, 1) : Time.now mtime = insecure_download ? Time.new(1970, 1, 1) : Time.now
FileUtils.touch(target, mtime:) unless skip_download FileUtils.touch(target, mtime:) unless skip_download
JSON.parse(target.read, freeze: true) JSON.parse(target.read(encoding: Encoding::UTF_8), freeze: true)
rescue JSON::ParserError rescue JSON::ParserError
target.unlink target.unlink
retry_count += 1 retry_count += 1