in reply to How to handle UTF-8 content with Win32::IE::Mechanize
Why not use the open pragma use open qw(:std :utf8); ORbinmode like so: binmode FILEHANDLE, LAYER. i.e
open DEBUGFILE, '>', "debug.txt" or die $!; binmode DEBUGFILE, ":encoding(UTF-8)";
OUTPUT:use WWW::Mechanize; ... # get the DOM document #my $doc = $mech->{agent}->Document; # comment out # get the webpage title my $title = $mech->title; # used instead ... # create a utf-8 text file open DEBUGFILE, '>', "debug.txt" or die $!; binmode DEBUGFILE,":encoding(UTF-8)"; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to handle UTF-8 content with Win32::IE::Mechanize
by Anonymous Monk on Dec 03, 2012 at 11:44 UTC | |
by 2teez (Vicar) on Dec 03, 2012 at 14:59 UTC | |
by Anonymous Monk on Dec 03, 2012 at 15:18 UTC | |
by 2teez (Vicar) on Dec 03, 2012 at 16:56 UTC | |
by Anonymous Monk on Dec 03, 2012 at 18:12 UTC |