archive/zip: fix handling of replacement rune in UTF8 check
The replacement rune is a valid rune and can appear as itself in valid UTF8 (it encodes as three bytes). To check for invalid UTF8 it is necessary to look for utf8.DecodeRune returning the replacement rune and size==1. Change-Id: I169be8d1fe61605c921ac13cc2fde94f80f3463c Reviewed-on: https://go-review.googlesource.com/78126 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Showing
Please
register
or
sign in
to comment