pretty-printing of foreign wchar_t

[email protected] (YAMAMOTO Takashi) Fri, 4 Jun 2010 00:35:11 +0000 (UTC)
Newsgroups gmane.os.netbsd.devel.general,gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
hi,

if i wanted to pretty-print foreign wchar_t, i'd do:

1. if the encoding of it is known and supported by the local iconv
  implementation, try to iconv it to nl_langinfo(CODESET) and printf.
  (assuming that nl_langinfo(CODESET) is a valid iconv codeset name.
  it works for netbsd, but unfortunately is not portable, iirc.)

2. otherwise, simply print it as a byte stream.

YAMAMOTO Takashi