Read a file character by character/UTF8: Difference between revisions

From Rosetta Code
Content added Content deleted
(initial draft)
 
m (Whoops?)
Line 1: Line 1:
{{draft task|File handling}}
{{draft task|File handling}}
Read a file one line at a time, as opposed to [[Read entire file|reading the entire file at once]].
Read a file one character at a time, as opposed to [[Read entire file|reading the entire file at once]].


The solution may be implemented as a stateful procedure, which returns the next character in the file on each consecutive call (returning EOF when the end of the file is reached).
The solution may be implemented as a stateful procedure, which returns the next character in the file on each consecutive call (returning EOF when the end of the file is reached).

Revision as of 11:39, 17 March 2013

Read a file character by character/UTF8 is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

Read a file one character at a time, as opposed to reading the entire file at once.

The solution may be implemented as a stateful procedure, which returns the next character in the file on each consecutive call (returning EOF when the end of the file is reached).

The procedure should support the reading of files containing Unicode wide characters, returning whole characters for each consecutive read.

See also: Read a file line by line.