RepoIndex: make sure the PrintWriter is closed

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Read a stream as UTF-8

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>