Bryan Kadzban пишет:
"Just after a stream is associated with a pipe by the popen()
function, the stream is byte-oriented."


Where is that quoted from?
http://docs.hp.com/en/B9106-90012/orientation.5.html
This is for HP-UX, but it's true for glibc to.

I was not aware that there was a difference between "byte-oriented" and
"wide-oriented" streams.  I thought getwc did the conversion between
LC_CTYPE charset and wide-char itself, though I see the getwc manpage
only says that "it is reasonable to expect" this in "the absence of
additional information passed to the fopen call".

This Debian i18n page seems to imply that it should work (see 6.3), and
it's what I was going from:

http://www.debian.org/doc/manuals/intro-i18n/ch-locale.en.html
getwc() crashes application on byte-oriented stream. Some info can be
found in glibc manual:
http://www.gnu.org/software/libc/manual/html_node/Streams-and-I18N.html

But if there is a difference, then the iconv sample on that page (see
6.5) could be a better choice than hardcoding the UTF-8 conversion, and
(therefore) only working in a UTF-8 charset environment.
Sorry for that, i'm not a C programmer :)
(Plus, you
don't know what the user will set LC_CTYPE to; it might be utf8, it
might be utf-8, it might be UTF8, and any of these will break the
patch.)
Standard recomends using UTF-8.


--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to