in reply to Net::Google and non-English languages

Maybe if you show us a little bit of your code, or at least make it clear how you are specifying the search terms. If you're not using actual utf8 text data, that might be the problem, since according to man page for Net::Google that's what is needed.

There are lots of ways to get that wrong...

  • Comment on Re: Net::Google and non-English languages

Replies are listed 'Best First'.
Re^2: Net::Google and non-English languages
by szabgab (Priest) on Sep 06, 2005 at 11:46 UTC
    The code is the the one I saw in the Synopsis of Net::Google
    use Net::Google; use constant LOCAL_GOOGLE_KEY => "********************************"; my $google = Net::Google->new(key=>LOCAL_GOOGLE_KEY); my $search = $google->search(); use utf8; my $str = "פרל"; $search->query($str); map { print $_->URL()."\n"; } @{$search->results()};
    I even checked using the is_uft8 function of Encode if the string is in utf8 and it reported true.

    Actually gaal and I have even ran tcpdump on the port and it seemed that the string was sent out correctly.

    ps. It seems that the Monastery (or my browser ?) turned the real Hebrew string above into some strange representation.

      I've never used Net::Google myself (or the Google SOAP API either), so I hope others can help more than I can. (E.g. I don't know whether your "local google key" value is literally a string of asterisks, or whether you're just using that to mask some actual private string assigned to you somehow by google.)

      Anyway, does your "ps" comment at the end refer to the string being assigned to "$str" in that snippet, and does this explain why you have  "פרל" there instead of actual utf8 data? Have you tried doing it like this:

      my $str = "\x{1508}\x{1512}\x{1500}";
      If not, try that. (Just a shot in the dark..)