utf8 doesn't work



hi again.
 --- Dov Grobgeld <dov grobgeld weizmann ac il>
的正文:
Try adding:

    use utf8;

at the beginning of the perl program. You should
then be able to just
enter the utf8 characters with any editor that
supports it. For examples
of utf8 use with Perl/Gtk2 see:

   

http://imagic.weizmann.ac.il/~dov/lectures/yapc-2004-perl-gtk2/slides.html

Regards,
Dov

On Wed, Aug 04, 2004 at 05:03:51PM +0800, Lich Lee
wrote:
I tried to use:
$entry -> set_text("????");
"????" is chinese character, I don't kown if your
computers support.
I couldn't set text to chinese. It showed me some
troubled code but I could read chinese by $entry
->
get_text() to a varirable, and print it to the
shell
where everything looks well.
I've tried 

use Encode;
$entry -> set_text(encode('utf8', "????"));

Doesn't work;
so, ask for help.
thx alot.


Things didn't get change.
I'm using a socket to send chinses character from a
computer to another.
I did use utf8. It's still showing some strage code.
I'm sure it's no matter about the socket because (see
the code commet :P )

sever code is here::
while(sysread($connection, $buffer, 2048)){     
                        chop($buffer);
                        chop($buffer);
                        print "$buffer\n";###I print gets to Termial, all
character are ok.
                        $entry -> set_text($buffer);###After setting text,
the entry's text is not what it should be.
}

client code::
        my $text = $entry -> get_text;###I input chinese
here.
        print $text."\n"; ###Print out what I print
in,chinese is ok.
        $text = $text."\r\n";
        printf $sock $text;###Send out, every thing should be
all right here.

I've also tried setting the
$ENV{LC_ALL}='zh_CN',nothing happened.

in trouble. thx for help.

and another question is:
If I want to reply a mail, should I just reply that
mail or
copy the title and add a "re" to send to the mail-list?

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/



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