<div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 2, 2017 at 11:52 AM, Brian J. Murrell <span dir="ltr"><<a href="mailto:brian@interlinx.bc.ca" target="_blank">brian@interlinx.bc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2017-03-02 at 14:27 -0500, Brian J. Murrell wrote:<br>
> QT bug?<br>
<br>
Or not:<br>
<br>
#include <QString><br>
#include <QUrl><br>
#include <iostream><br>
<br>
using namespace std;<br>
<br>
main() {<br>
<br>
QUrl qurl = QString("This:");<br>
cout << qurl.toDisplayString().<wbr>toLocal8Bit().constData() << "\n";<br>
<br>
}<br>
<br>
produces:<br>
<br>
this:<br>
<br>
Something to do with the QUrl type perhaps. If I remove the trailing :<br>
on the string, case is preserved.<br>
<br>
Cheers,<br>
b.<br></blockquote></div><br></div><div class="gmail_extra">I think that makes sense. QT is assuming that a colon marks the end of the scheme part of the URI. Wikipedia says "Although schemes are case-insensitive, the canonical form is lowercase
and documents that specify schemes must do so with lowercase letters." (<a href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax">https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax</a>) I assume that QUrl is applying encoding to the string to create a valid URL, and when it encodes the string it puts what it thinks is the scheme part into canonical form (i.e., lower case). I haven't looked at the full code but maybe it it were prefixed with file: (or file://) it might behave better?<br><br></div><div class="gmail_extra">Karl<br><br></div></div></div>