Skip to content

Commit 04a1314

Browse files
committed
Ignore invalid byte sequence in UTF-8
1 parent 27b6faa commit 04a1314

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: shell/key-bindings.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if command -v ruby > /dev/null; then
7171
7272
h = {}
7373
i = 0
74-
File.read("/tmp/fzf-bash-history").scan(/^#([0-9]+)$\n(.*?)\n(?=^#[0-9]+$|\z)/m) do |t, c|
74+
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|
7575
next if c.empty?
7676
h.delete(c)
7777
h[c] = [i += 1, t]

0 commit comments

Comments
 (0)