Fix handling of eof, so -1 is not sent to character-set conversion
routines.
Authored by: dwarren 2014-04-01
Parent: [r7941]
Child: [r7943]