Close converter

This commit is contained in:
kristen1980 2017-04-21 15:54:10 -06:00 committed by GitHub
parent 8960e66bd3
commit f5db214e8b

View File

@ -18,7 +18,9 @@ func NewReader(source io.Reader, fromEncoding string, toEncoding string) (*Reade
converter, err := NewConverter(fromEncoding, toEncoding)
if err == nil {
return NewReaderFromConverter(source, converter), err
reader := iconv.NewReaderFromConverter(source, converter)
converter.Close()
return reader, err
}
// return the error