JJ / google-scholar-perl

Automatically exported from code.google.com/p/google-scholar-perl
0 stars 44 forks source link

Problems when run on Win32 platforms #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
>What steps will reproduce the problem?

 1. install on Windows XP , locale zh-tw
 2. run ...\My-Google-Scholar\examples>perl search_title.pl
 3. error messages produced

>What is the expected output? What do you see instead?

In addition to the output, some error messages are shown:
1. '$ENV{HOME}/.lwpcookies.txt' not found
2. 'Malformed UTF-8 character (unexpected continuation byte 0xa0, with no 
preceding start byte) at ../lib/My/Google/Scholar/Paper.pm line 31.'

>What version of the product are you using? On what operating system?

The version 0.0.5 on Windows XP sp3.

>Please provide any additional information below.

Workarounds:
1. Add the following to line 32 of Scholar.pm (ref. 
http://coding.derkeiler.com/Archive/Perl/comp.lang.perl.misc/2007-
04/msg01190.html , but be careful about the type $SENV)
  BEGIN {
    if ( substr ( $^O, 0, 5 ) eq q{MSWin} ) {
        if ( $ENV{HOME} ) {
        # leave as is
        }
        elsif ( $ENV{USERPROFILE} ) {
            $ENV{HOME} = $ENV{USERPROFILE};
        }
        elsif ( $ENV{HOMEDRIVE} and $ENV{HOMEPATH} ) {
            $ENV{HOME} = $ENV{HOMEDRIVE} . $ENV{HOMEPATH};
        }
        else {
            $ENV{HOME} = '.';
    } } }
2.Open and save Paper.pm in utf-8 format

Original issue reported on code.google.com by sig.tz...@gmail.com on 17 May 2010 at 11:08

Attachments: