title: Check if UTF-8 string is valid in Qt
body: <p>In Qt, is there a way to check if a byte array is a valid UTF-8 sequence?</p>
  
  <p>It seems that <a href="http://qt-project.org/doc/qt-5.0/qtcore/qstring.html#fromUtf8">QString::fromUtf8()</a> silently suppresses or replaces invalid sequences, without notifying the caller that there were any. This is from its documentation:</p>
  
  <blockquote>
    <p>However, invalid sequences are possible with
    UTF-8 and, if any such are found, they will be replaced with one or
    more "replacement characters", or suppressed.</p>
  </blockquote>