Skip to content

Commit

Permalink
Merge pull request #57 from y-yagi/fix-garbled-text
Browse files Browse the repository at this point in the history
Specify an input encoding to `NKF` to avoid misjudgement
  • Loading branch information
jiikko authored May 2, 2023
2 parents cb2c24a + 2ad623a commit 3f5ce7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gmo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def api(path, args = {}, verb = "post", options = {}, &error_checking_block)
key_values = result.body.to_s.split('&').map { |str| str.split('=', 2) }.flatten
response = Hash[*key_values]
# converting to UTF-8
body = response = Hash[response.map { |k,v| [k, NKF.nkf('-w',v)] }]
body = response = Hash[response.map { |k,v| [k, NKF.nkf('-S -w',v)] }]
# Check for errors if provided a error_checking_block
yield(body) if error_checking_block
# Return result
Expand Down

0 comments on commit 3f5ce7c

Please sign in to comment.