News for hackers. Stuff that matters.
Re:Curl doesn’t spew binary anymore by baby on Saturday June 17, 2017 @08:05AM (#14575525)
> 1. It is not sensible to check more than a small chunk of data

You could just check the first X bytes. Also, I'm guessing curl doesn't print out to the terminal if the data is more than 2000 bytes anyway?

> 2. Then the check yields a false negative, which is not a problem.

the binary will be printed on the screen, that's a problem

> 3. Then your UTF-8 string is unprintable, and the check will yield a true positive.

How is it that the zero byte is part of UTF-8 then?

Re:Curl doesn’t spew binary anymore by dozzie on Saturday June 17, 2017 @10:43AM (#14576094)
>> 1. It is not sensible to check more than a small chunk of data

> You could just check the first X bytes. Also, I'm guessing curl doesn't print out to the terminal if the data is more than 2000 bytes anyway?

Why wouldn't it? 2000 bytes is just 25 lines by 80 characters.

Re:Curl doesn’t spew binary anymore by baby on Sunday June 18, 2017 @02:41AM (#14579334)
right, it sounded bad for some reason!
Re:Curl doesn’t spew binary anymore by masklinn on Saturday June 17, 2017 @04:05PM (#14577483)
> You could just check the first X bytes. Also, I'm guessing curl doesn't print out to the terminal if the data is more than 2000 bytes anyway?

Of course it does. You can curl the concatenated content of the library of congress to your terminal if you want to.

> the binary will be printed on the screen, that's a problem

No. Because printing the binary to screen is the current behaviour in all cases, the goal of this change is to reduce the incidence of it for quality of life.

> How is it that the zero byte is part of UTF-8 then?

Flash News: unprintable characters are part of unicode. NUL is one of them.

Re:Curl doesn’t spew binary anymore by baby on Sunday June 18, 2017 @02:41AM (#14579329)
Thanks for your non-answers :)
Re:Curl doesn’t spew binary anymore by Freak_NL on Saturday June 17, 2017 @12:04PM (#14576427)
> How is it that the zero byte is part of UTF-8 then?

It is a valid code point, just not a printable character. Unicode encodes every character that is or was in common use, not just the printable characters; this includes the control characters at the beginning of the ASCII table.