IsUTF8: check if a string is a valid UTF8 sequence without modifying it
EnsureUTF8 would replace invalid bytes sequences with question marks. Most of the code was already there anyway. This allows UTF-8 autodetection without a dedicated UTF8-to-UTF8 iconv() handle.
Showing with 41 additions and 14 deletions