Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] perl/curses/utf8



On 2011/08/05 16:15, Stephen J. Turnbull wrote:
s smith writes:

  >  Does anyone on the list use perl curses in utf8.  I can't seem to get
  >  even printw to work and can't find anything on the web indicating it's
  >  possible.

Why not just use print to an appropriate terminal (Ie, one that groks
UTF-8)?  That's the whole point of UTF-8 -- an 8-bit clean application
will just DTRT.  At least in the standard C library, printw is for
widechars, ie, UTF-16 or UTF-32.  But Perl's Unicode support is
internally an extension of UTF-8 AFAIK, so `printw' in Perl doesn't
make much sense to me.  (But then, not much in Perl does make sense to
me, I'd rather read raw modem traffic. :-)

I took a passing look at the Curses module, and it is seen to be not unicode aware. So maybe you should try to encode the string to UTF-16/32 before passing it to printw?
(using the Encode module)

Shmuel.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links