bytestring?

Michael Truog <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
I was wondering if there was interest in modifying the io interpretation 
of "~ts" to allow an integer between the t and s for forcing a 
particular unicode interpretation.  That would allow a list of bytes to 
be interpreted as UTF8, to provide the same output as a binary:
1> io:format("~ts~n",[<<16#C2,16#A2>>]).
¢
ok
2> io:format("~t8s~n",[[16#C2,16#A2]]).
¢
ok

I was also wondering if bytestring types would be added to Erlang/OTP, like:
-type nonempty_bytestring() :: nonempty_list(byte()).
-type bytestring() :: list(byte()).

They are useful in iolists to ensure only bytes (not other integers) are 
in nested lists.

Best Regards,
Michael
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.