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 22, 2024
1 parent 27b6faa commit 04a1314
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 04a1314

Please sign in to comment.