Julia binary data gotcha!

One more time on this topic.

After the following code runs, as expected the file is created of 128 (0-127) bytes in length! However that is not true if you increase the upper bounds of the for loop over 127. And the Invalid message never appears!

fo=open("binary.fil", "w")
for i=0:127
local oneByte
oneByte=Char(i)
ln=length(oneByte)
if ln>1
println("Invalid")
end
write(fo, oneByte)
end
close(fo)

The following code however…works. And creates a 256 (0-255) byte file, X’00’-X’FF’.
>>>>>>>>>>> Note how oneByte is defined different <<<<<<<<<<<

fo=open("binary.fil", "w")
for i=0:255
local oneByte
oneByte=UInt8[i]
ln=length(oneByte)
if ln>1
println("Invalid")
end
write(fo, oneByte)
end
close(fo)