-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
I'm trying to encode invalid bytes as "#" like in the documentation example:
iso = Codepagex.from_string!("Hello æøå!", :iso_8859_1) <> <<1, 1, 1, 1>>
missing_fun =
fn _encoding ->
inner_fun =
fn <<_, rest::binary>>, acc ->
{:ok, "#", rest, acc}
end
{:ok, inner_fun}
end
Codepagex.to_string(iso, :iso_8859_1, missing_fun)
But this returns the following:
{:ok, <<72, 101, 108, 108, 111, 32, 195, 166, 195, 184, 195, 165, 33, 1, 1, 1, 1>>, nil}
Is there a way to do what I want ?
Thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels