On 10/14/18 2:21 AM, Ralph Mellor wrote:
OK. That makes sense.

So the program that you're running for the $proc is producing
malformed UTF8. Why don't you fix that rather than clean up
afterwards?

--
raiph

Hi Raiph,

I am reading the contents from a web page through my "curl"
interface module (CurlUtils.pm6).  The bad characters are
coming from a particular web page. I have no control over it.

:'(

But with Perl, there are 1001 ways to do everything and I
noticed on

   https://docs.perl6.org/routine/slurp-rest

   DEPRECATION NOTICE: this method will be deprecated in 6.d
   language. Do not use it for new code. Use .slurp method
   method instead.

And I also noticed on the examples of

    https://docs.perl6.org/routine/slurp  and
    https://docs.perl6.org/language/unicode#index-entry-UTF8-C8

That is can use an "enc" (encode?) command:

   say slurp($test-file, enc => 'utf8-c8');

And since

if $StdOut { $ReturnStr = $$proc.out.slurp-rest( enc => 'utf8-c8' ); }

    Can not assign to an immutable value

When I get some time to code again, I will switch my
RunNoShell.pm6 module, which CurlUtils.pm6 uses extensively,
to use "slurp" instead of "slurp-rest".  Plus I use "slurp"
extensively everywhere else, so ...

-T

Reply via email to