http://qs1969.pair.com?node_id=521199


in reply to How to Remove Junk Characters

I am not sure what you mean by "junk" characters. May you post an example of what you mean?

I took out the proxy lines and ran the code; the file downloaded without any errors. However, I think you are referring to accented characters such as ö in the source - Use HTML::Entities if you want to encode them into the proper ö format.

But please post an example so we can be sure of what you want.

~abseed

Replies are listed 'Best First'.
Re^2: How to Remove Junk Characters
by Rajeshk (Scribe) on Jan 06, 2006 at 05:47 UTC

    Hi Monks,

    Here are some sample junk characters Downloaded files Input -- Original Output =========================================== 1. jury trial. For his -- jury trial. For his 2. Börries Ahrens -- Börries Ahrens 3. Aldejohann’s main -- Mr. Aldejohann’s 4. University of MĂĽnster -- University of Münster 5. the €625 million senior and €130 -- €625 million senior and €1 +30 6. acquisition of a properties’ -- acquisition of a properties’ 7. Westfield College – University -- Westfield College – University + 8. TelĂ©fonos -- Teléfonos 9.(CelumĂłvil S -- (Celumóvil S 10. Dr. jur., 1990, with a dissertation on “Die Unabhängigkeit des +genossenschaftlichen PrĂĽfungsverbandes” (“The Independence of th +e Cooperative Inspection Association”) --- Dr. jur., 1990, with a dissertation on "Die Unabhängigkeit des genosse +nschaftlichen Prüfungsverbandes" ("The Independence of the Cooperativ +e Inspection Association")

    Thanks,
    Rajesh.K

      Change
      my $file_cnt = $res->content;
      to
      my $file_cnt = $res->decoded_content;

      See HTTP::Message for an explanation of the difference.

      Many thanks to the search artist kwapping for finding it and to tye for explaining it :-)