mirror of
https://github.com/junegunn/fzf.git
synced 2024-09-11 14:35:26 +03:00
Ignore invalid byte sequence in UTF-8
This commit is contained in:
parent
c790ab2024
commit
e8a39eeb0f
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user