perl-diddler has asked for the wisdom of the Perl Monks concerning the following question:
I.e, lets say for simplicities' sake, that I want to be able able to specify a URL, and have it fetched into memory, and then saved.
I'm running into a bit of a dilemma -- when I try to treat the contents as UTF-8 -- that works fine for the pages I'm fetching (that happen to use the XHTML standard UTF-8), but it definitely doesn't work when I save binary files.
When I tried to fetch things as binary, that didn't work and I ended up with weird diamond-shape marks where quotes should be (a 'feature' of UTF-8 being misinterpreted as western).
Unfortunately, I can't tell the type from the file name, as some files are simply "site/get?item=xxx, where xxx could return text or an image.
I'm not at wits end on this yet, but in trying to trim down some verbose output, I hit on another problem that I've already posed a Q on here .. so while waiting for some ideas on that, I thought I'd try to pick people's brains a bit rather than just dash my head against documentation and various functions until I have a breakthrough or a headache and THEN end up here...(i.e. w/insight, I might save myself some time!) :-)
thanks...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP::Curl and character encoding
by Anonymous Monk on Nov 16, 2010 at 11:58 UTC | |
by perl-diddler (Chaplain) on Nov 16, 2010 at 12:34 UTC | |
by Anonymous Monk on Nov 16, 2010 at 12:55 UTC | |
by perl-diddler (Chaplain) on Nov 16, 2010 at 13:16 UTC | |
by Anonymous Monk on Nov 16, 2010 at 13:31 UTC | |
| |
by perl-diddler (Chaplain) on Nov 16, 2010 at 13:28 UTC | |
by Anonymous Monk on Nov 16, 2010 at 13:37 UTC | |
by perl-diddler (Chaplain) on Nov 16, 2010 at 14:09 UTC | |
by Anonymous Monk on Nov 16, 2010 at 14:35 UTC |