I really think that the key here is the nature of files being downloaded:
- timezone files are text files.
- lang files and environmental files are zip files
and it seems that the libcurl-emu (when executing external OS curl executable), returns information "inline" with some extra info attached (sizes, times... are concatenated to the binary result).
I guess that curl-emu code then tries to strip that attached info and it causes the binary contents to become garbled.
So perhaps, when using external executable, we should separate both that statistical info and the binary file itself to prevent that garbled files.
Once done, those .zip binary files should arrive perfectly to Moodle.
In fact, that would be perfect because I've another bug ( MDL-12024 ) about timezones info open and I really want to change it to use the central component download methods. That implies downloading .zip files and that's the problem right now.
Ciao 
+5 for this. Sam is familiar with it.