normalizeUrlEncoding static method
Normalizes a URL string by decoding it once if it appears to be double-encoded
Implementation
static String normalizeUrlEncoding(String urlString) {
if (isDoubleEncoded(urlString)) {
debugPrint('Detected double-encoded URL: $urlString');
final normalized = Uri.decodeComponent(urlString);
debugPrint('Normalized to: $normalized');
return normalized;
}
return urlString;
}