Cleanup of PR #129: Add a encoding parameter for readline