The current code incorrectly returned true if the string contained an invalid UTF-8 sequence after an embedded NUL. Check the entire string if the length was explicitly given instead of stopping at the first NUL. Closes https://github.com/wxWidgets/wxWidgets/pull/236