Invalid_argument("UTF8.next") when iterating a split string

I’m trying to make a file reader and it has to read every line. I had this issue and found out it happens in a for loop.

var lines:String = File.getContent(fullPath);
for (line in lines.toString().split('\n') /* here is the error */)
{
// more code
}

The files exist, the directory exists, I’ve implemented many checks and the only thing that works is removing the .split("\n") which iterates through ints (I’m guessing they’re byte values for each character).