L
Lauri Alanko
It seems that the standard I/O operations for wide characters are
conspicuously lacking functions that read or write an array of
arbitrary wide characters into a stream. E.g. for writing, there's
only fputws, which writes a L'\0'-terminated string, not including the
terminator. So if there's a buffer that may contain L'\0', one has to
iterate it using fputwc, maybe with the assistance of fputws if an
exact count of successfully written characters is not needed.
The workaround is not a big deal, but this seems like a strange
omission, since otherwise there are wide I/O counterparts for all
basic byte I/O operations. Granted, mixing text and null characters is
not very common, but it does happen, e.g. when null characters are
used as field separators.
So does anyone have an idea why "fwwrite" and "fwread" are missing?
Thanks,
Lauri
conspicuously lacking functions that read or write an array of
arbitrary wide characters into a stream. E.g. for writing, there's
only fputws, which writes a L'\0'-terminated string, not including the
terminator. So if there's a buffer that may contain L'\0', one has to
iterate it using fputwc, maybe with the assistance of fputws if an
exact count of successfully written characters is not needed.
The workaround is not a big deal, but this seems like a strange
omission, since otherwise there are wide I/O counterparts for all
basic byte I/O operations. Granted, mixing text and null characters is
not very common, but it does happen, e.g. when null characters are
used as field separators.
So does anyone have an idea why "fwwrite" and "fwread" are missing?
Thanks,
Lauri