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

Fix encoding error on columns when using Trilogy #466

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
5 changes: 5 additions & 0 deletions lib/blazer/adapters/sql_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def run_statement(statement, comment, bind_params = [])
# fix for non-ASCII column names and charts
if adapter_name == "Trilogy"
columns = columns.map { |k| k.dup.force_encoding(Encoding::UTF_8) }
rows.each do |row|
row.each do |column|
column.force_encoding(Encoding::UTF_8) if column.is_a?(String)
end
end
end
rescue => e
error = e.message.sub(/.+ERROR: /, "")
Expand Down