Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure target_file returns utf-8 files #1853

Merged
merged 5 commits into from
Jan 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openc3/lib/openc3/utilities/target_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def self.body(scope, name)
# First try opening a potentially modified version by looking for the modified target
if ENV['OPENC3_LOCAL_MODE']
local_file = OpenC3::LocalMode.open_local_file(name, scope: scope)
return local_file.read if local_file
return local_file.read.force_encoding('UTF-8') if local_file
jmthomas marked this conversation as resolved.
Show resolved Hide resolved
end

bucket = Bucket.getClient()
Expand All @@ -107,7 +107,7 @@ def self.body(scope, name)
if File.extname(name) == ".bin"
resp.body.binmode
end
resp.body.read
resp.body.read.force_encoding('UTF-8')
jmthomas marked this conversation as resolved.
Show resolved Hide resolved
else
nil
end
Expand Down
Loading