Skip to content

Commit

Permalink
feat: use vim.iconv
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Dec 16, 2022
1 parent 947811c commit ebafcf5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions lua/gitsigns/git.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions teal/gitsigns/git.tl
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,13 @@ function Repo:get_show_text(object: string, encoding: string): {string}, string
if encoding ~= 'utf-8' then
scheduler()
for i, l in ipairs(stdout) do
-- TODO(lewis6991): How should we handle blob types?
if vim.fn.type(l) == vim.v.t_string then
stdout[i] = vim.fn.iconv(l, encoding, 'utf-8')
if vim.iconv then
stdout[i] = vim.iconv(l, encoding, 'utf-8')
else
-- vimscript will interpret strings containing NUL as blob type
if vim.fn.type(l) == vim.v.t_string then
stdout[i] = vim.fn.iconv(l, encoding, 'utf-8')
end
end
end
end
Expand Down

0 comments on commit ebafcf5

Please sign in to comment.