Skip to content

Commit

Permalink
Guard on the encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Nov 10, 2023
1 parent 60674c9 commit 26f9a3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/unicode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ defmodule Unicode do
end
end

def replace_invalid(binary, encoding, replacement) do
def replace_invalid(binary, encoding, replacement)
when encoding in [:utf8, :utf16, :utf16be, :utf16le, :utf32, :utf32be, :utf32le] do
Unicode.Validation.replace_invalid(binary, encoding, replacement)
end

Expand Down

0 comments on commit 26f9a3c

Please sign in to comment.