'\0' unicode character appearing at end of javascript files

'\0' unicode character appearing at end of javascript files

So this isn't a jQuery specific question specifically but i've been wrestling with the for the past day and a half. 

I have a javascript file in my app called main.js that when the browser loads it from the the virtual centos server I have on my MBP it adds a bunch of '\0' unicode characters to the end of the file and doesn't load the whole file, usually stopping somewhere randomly near the end. I've verified that there are no extra invisible characters in the file. If I rename the file and link to its new name the problem doesn't happen until I save it again. I've deleted the files and recreated them using three different editors. This is driving me mad, does anyone have any suggestions?