473,587 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LWP::Simple and utf8 problem

Hi,

I want to retrieve a webpage that includes unicode characters using the
LWP::Simple module. But how can I tell LWP::Simple which coding it should
use as I haven't found anything concerning coding in the docs.

I use the following:

---
#!/usr/bin/perl -w

use strict;
use warnings;
use LWP::Simple;

my $file = "tmpfile";
my $url;

$url**=*"http://www.ncbi.nlm.ni h.gov/entrez/eutils/efetch.fcgi?";
$url .= "db=Pubmed&retm ax=500&id=15017 969&retmode=xml ";

getstore($url, $file);
exit;
-----

As it seems, the unicode characters are not correctly stored in the file. As
I'm not very familiar with utf8 stuff, I'd like to ask for a hint on how to
correctly store utf8-encoded webpages in a local file...!?

Tom

Jul 19 '05 #1
0 2108

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12645
by: Woogie | last post by:
When running the sample code below without a proxy the GET returns the expected data. When run with the $proxy uncommented the GET returns the content of the login page for the site being accessed. The site in the code is valid for ease of testing. I also am including the LWP debug info for each attempt. Can anyone explain this behavior...
2
7887
by: john brown | last post by:
I'm using the following code to retrieve a web page. It seems that I'm able to pass the username and password to the web page, but it does nothing. Looking at the source code of the web page it asks for an "OnClick", which I figure refers to the "enter" button, (there's also a reset button after the "enter" button.) I do I go about send...
6
3107
by: Richard Bell | last post by:
I'm returning to Perl and Linux after many years away and while I know/knew way back when about Perl and Unix I'm new to this world today. I'm considering using LWP as the heart of a Web application and have a number of questions. It appears to me that the Get method returns ONLY the content of the single object referenced by the URL. ...
0
1197
by: jnair | last post by:
from the perl man pages of LWP::Simple mirror($url, $file) Get and store a document identified by a URL, using If-modified- since, and checking the Content-Length. Returns the HTTP response code. is there something similar in python
0
2542
by: sharif | last post by:
Anyone could help me out for n=my code ......I have written following code ,Here i m able to get and post the form successfuly..but after posting im not gettng proper response content... #!usr/bin/perl -w use strict; use LWP; use LWP::Simple; use LWP::UserAgent; use HTML::Form; use Switch; use HTTP::Cookies;
8
2987
by: pplers | last post by:
i wanted a script to check whether a premium account is still working or not, so i tried these: use LWP::Simple; open (IN, 'accounts.txt'); while (<IN>) { chomp; $user=substr($_,0,5); $pass=substr($_,6,6);
1
1486
by: Freedolen | last post by:
Hi All, With the below code i am able to get the contents, but i need to get the filename whether it is 'index.html' or 'index.htm' or 'google.html'. How can i get it? use strict; use LWP::Simple; my $htmlcontent = get("http://www.google.co.in"); print $htmlcontent; Thanks in Advance,
3
3327
by: cketcham | last post by:
All, I have the following code: use 5.010; use LWP::UserAgent; use URI::URL; use LWP::Debug qw(+); my $browser = LWP::UserAgent->new();
1
1685
by: dibyenduchatterjee | last post by:
Am using LWP module. I wish to read a page and print a part of it. I want t read first 300 characters of <div id="bodyContent"> written inside the html page. Code I am using : #!/usr/bin/perl use DBI; use CGI; use LWP::Simple;
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.