mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-28 02:31:59 -07:00
Ignore invalid byte sequence in UTF-8
This commit is contained in:
@@ -71,7 +71,7 @@ if command -v ruby > /dev/null; then
|
|||||||
|
|
||||||
h = {}
|
h = {}
|
||||||
i = 0
|
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?
|
next if c.empty?
|
||||||
h.delete(c)
|
h.delete(c)
|
||||||
h[c] = [i += 1, t]
|
h[c] = [i += 1, t]
|
||||||
|
Reference in New Issue
Block a user