This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Nex4rius's profile picture

download files from the internet

Started by Nex4rius, 15 July 2017 - 09:40 AM
Nex4rius #1
Posted 15 July 2017 - 11:40 AM
I've tried to make myself a wget function to download any website (probably only from github) to my computer.

This is it.

I have a problem with the encoding it seems that it doesn't like the characters that I'm using. I downloaded it with my program and then compared it with what was originally on github.

There is also another problem when I try to view the downloaded file.
https://www.youtube....h?v=0d0WJSGMUC0
It is giving me an error at line 880 which I don't understand.
supernicejohn #2
Posted 15 July 2017 - 08:47 PM
Seems it isn't compatible with certain characters, also seems like the default edit program struggles with german, and for some reason setting different lengths of strings in the drawing call for the comment "– grün".
I've seen a little of how the edit program does things so the comment is being matched separately, and something is just wrong with what it does there. Maybe translating "ü" into something else halfway through…

Maybe a newer version of CC would help? It displays correctly on emulated CC 1.79 for me.
Bomb Bloke #3
Posted 16 July 2017 - 02:16 AM
The version of ComputerCraft is definitely relevant here.

Prior to CC1.76, you're able to transmit ASCII only (that is, characters 0-127). The only way to deal with anything else is to encode it into something like base64 first, and then to decode after downloading.

After that version a number of other characters are included, but it's still far from total unicode support. I think it should handle all the characters you're showing there, though.

The 1.80WIP builds support binary-mode web handles, which allows the included wget to grab any file correctly.
Nex4rius #4
Posted 16 July 2017 - 10:07 AM
I still have CC 1.75.

Thanks for the help I will try out the newer versions.