
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] perl/curses/utf8
On 08/06/2011 05:06 AM, Shmuel Fomberg wrote:
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.
Hi Shmuel.
I tried both the 'use utf8' and Encode. The code below is what I'm
trying to execute. The first print/sleep is just so I can see that the
string looks right.
I was hoping someone over there still used the Curses over there and had
already been through this.
I just found a link indicating that by default the code is linked with a
library that doesn't support wide characters and gives instructions on
how to fix this. Let me see what happens with this.
Thanks very much for your reply.
On 08/05/2011 12:15 AM, Stephen J. Turnbull wrote:
,,,
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. :-)
Stephen -- for what it's worth, much of emacs doesn't make much sense to
me. :)
I think with curses, printw is print to window not print wide, but I
don't have that much experience with Curses package -- perl or C.
Thanks.
Steve S.
=========
use Curses;
use Encode qw(encode decode);
binmode(STDOUT, ':utf8');
my $str = decode 'utf8', 'よろしく、世界';
print $str, "\n";
sleep 5;
initscr();
printw("Hello world!\n");
printw($str);
refresh();
getch();
endwin();
Home |
Main Index |
Thread Index