Skip to content

Commit

Permalink
Ignore invalid byte sequence in UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Jul 29, 2024
1 parent c790ab2 commit e8a39ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shell/key-bindings.bash
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if command -v ruby > /dev/null; then
h = {}
i = 0
File.read("/tmp/fzf-bash-history").scan(/^#([0-9]+)$\n(.*?)\n(?=^#[0-9]+$|\z)/m) do |t, c|
File.read("/tmp/fzf-bash-history").encode!("UTF-8", "UTF-8", :invalid => :replace).scan(/^#([0-9]+)$\n(.*?)\n(?=^#[0-9]+$|\z)/m) do |t, c|
next if c.empty?
h.delete(c)
h[c] = [i += 1, t]
Expand Down

0 comments on commit e8a39ee

Please sign in to comment.