It's probably related to encoding issues.
Before reading the file try this:
myFile.encoding = "UTF8";
Didn't help. Is this after the file has been opened (open("r")) of before?
What has helped is after the file is opened I do a File.seek(0) -- which
seems to set the counter back. But I don't understand why the alerts are
DIFFERENT each time.
I tend to avoid using readln() I tend to use read() and work with the whole file string directly.
I've had trouble getting readln() to work as I'd expect. Instead of struggling with it, I just took the easy way out and avoided it altogether...
Readln() seems to work for me, except for this weird thing. I had a look
at the txt file in a hex editor, and there's nothing there except for
the text and the line break characters (CR/LF on Windows and CR only on
In other words, there's no encoding bytes at all either on Windows or Mac.
And seek(0) seems to get things working again.
Still, I'd be curious to know what's going on. I would have thought that
a File.close() followed by a File.open("r") would reset any internal