mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-18 20:30:22 -07: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…
x
Reference in New Issue
Block a user