Do not use fromUtf8() if it is not necessary


- ASCII string literals do not need the fromUtf8() call.
- QUrl::toPercentEncoded() returns a QByteArray where all non-ASCII
  characters are percent-encoded, so it's safe to use fromLatin1()
  on it as well.
- QString::{starts,ends}With() can take a QChar (implicitly
  constructed from char16_t).

Amends 44762f86877135a0172b3f91516d897062dd9b24
and 7b9ca8694da72c098059e2c802b778f75764e4de.

Extend the tests to verify that non-ascii characters are properly
percent-encoded.

Task-number: QTBUG-137432
Pick-to: 6.11
Change-Id: Ic00d625c12ca190e5fdf4763016cadfed4874786
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitb377e74c039f6c3565192b4365d54563ec6096cd
parent9f0e06198d7088c29aeeaeacdb9216d5c8995203
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 11 Dec 2025 17:12:51 +0100