(che può essere CR, o in alcuni casi CR+LF)...

Evvero ma come individuo il carattere terminatore?