I suppose I don't need to binmode the output. Or, at least, this was what happened before.
No, what the utf8_output option does (this is now the default) >is that ReDIF-perl will not drop templates that contains >characters that are not in Latin-1. It has nothing to do with >how the data is processed when you print it.
If there is a change in behavior it is more likely that it is >caused by differences between Perl versions.
ok, thanks Sune, understood now.
/Sune
May be I did something wrong when installed the previous version. Could you please to instale the latest one. Thanks,
Jose Manuel Barrueco writes
This will not read any .redif files.
Do you have a minimal test handy? I may hit the sack though right now.
adnetec@shuli:~/perl$ cat test_names #!/usr/bin/perl
use strict; use warnings;
use ReDIF::init; use Encode;
use ReDIF::Parser qw( &redif_open_file &redif_get_next_template );
ReDIF::Parser::set_parser_options( x_attributes => 1, utf8_output => 1
);
my $file = '/home/adnetec/RePEc/remo/per/pers/s/psc418.rdf';
redif_open_file ( $file ); binmode(STDOUT,":utf8"); my $T; while ($T = eval {redif_get_next_template} ) { print "Author: $T->{handle}[0] -> $T->{'short-id'}[0] ...\n"; # print join '',encode("utf8", $T->{'name-last'}[0],
Encode::FB_CROAK)," # $T->{'name-first'}[0]\n";
print join '',$T->{'name-last'}[0]," # $T->{'name-
first'}[0]\n";
}
adnetec@shuli:~/perl$ ./test_names Author: RePEc:per:2010-06-10:MICHAEL_SCHROEDER -> psc418 ... Schröder # Michael
look at:
adnetec@shuli:~$ ll CitEc/var/test_names
---- José Manuel Barrueco <barrueco@uv.es>
--
Cheers,
Thomas Krichel http://openlib.org/home/krichel skype:thomaskrichel
--
-- José Manuel Barrueco <barrueco@uv.es>
_______________________________________________ ReDIF-dev mailing list ReDIF-dev@lists.openlib.org http://lists.openlib.org/cgi-bin/mailman/listinfo/redif-dev
-- -- José Manuel Barrueco <barrueco@uv.es>