How to read a line character by character?

here a related question