Pasha Zubkov wrote:
> Bryan Kadzban пишет:
> 
>> Why not just use getwc(), and use wchar_t's in all cases?
>> 
>> You'd have to modify the output to convert back to multibyte
>> characters (specifically, LC_CTYPE-encoding characters; they may
>> not actually have more than one byte per character), but it looks
>> like add_wch does that already.
> 
> "Just after a stream is associated with a pipe by the popen()
> function, the stream is byte-oriented."

Where is that quoted from?

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

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.  (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.)

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to