On Saturday, 16 July 2022 at 19:54:08 UTC, HuskyNator wrote: > File("test.txt", "w").write(a); The default here is write in text mode, change the "w" to "wb" and it won't molest your line endings any more.