Home: Perl Programming Help: Intermediate:
Wide character in print at main.pl line ...



Tumata
User


Apr 10, 2009, 8:39 AM


Views: 2227
Wide character in print at main.pl line ...

Hi! I have a question. I wrote script, that gets web page with help of LWP::UserAgent. Then I get one substring using regexp. And finally print this substring onto console. The problem is that this page contains russian words and when I printing it perl complains: "Wide character in print at main.pl line 13.". When I saw STOUT of my script throught hexdump I discovered that my string encoded with two bytes for character (substring also contains russian words). What is wrong with my script?


george.heller
New User

Apr 10, 2009, 1:53 PM


Views: 2218
Re: [Tumata] Wide character in print at main.pl line ...

Did you try printing the output in UTF8?

binmode(OUT, ":utf8");


Tumata
User


Apr 15, 2009, 5:53 AM


Views: 2177
Re: [george.heller] Wide character in print at main.pl line ...

It doesn't help me. Thanks any way. I should investigate this issue deeper..