Any chance to have an option to also escape null byte in String.replace_invalid ??
In utf-8 <<0>> is a valid character but there are problems with it:
- it's invalid in modified utf-8
https://en.wikipedia.org/wiki/UTF-8#Modified_UTF-8- postgres does not accept text containing it, you get an error character not in repertoire
- it's sometimes used as a string terminating sequence
- it cli apps when you try to get the actual string width it's problematic:
iex> String.length(<<0>>)
1
iex> IO.puts("-" <> <<0>> <> "-")
-^ - <- it has a width of 2 characters when printed in elixir. Some specifications also say to skip printing it at all.