When writing to a file you still need to convert those large codepoints to bytes,
so something like this untested:
io:put_chars(Fd, unicode:characters_to_binary(io_lib:format("String: ~ts~n", [UnicodeString])),
or just io:put_chars(Fd, unicode:characters_to_binary(UnicodeString)).
so something like this untested:
io:put_chars(Fd, unicode:characters_to_binary(io_lib:format("String: ~ts~n", [UnicodeString])),
or just io:put_chars(Fd, unicode:characters_to_binary(UnicodeString)).