[Interest] QFile::encodeName in all platforms

Thiago Macieira thiago.macieira at intel.com
Sat Jan 20 00:35:48 CET 2018


On Friday, 19 January 2018 14:01:54 PST Alejandro Exojo wrote:
> On 17 January 2018 at 18:30, Thiago Macieira <thiago.macieira at intel.com> 
wrote:
> >> The implementation just does QString::toLocal8bit() in Windows and Linux,
> >> and toUtf8() on macOS.
> > 
> > You should not call this function on Windows, at all.
> 
> What I feared, indeed. How about the documentation? Do you think the
> actual text is correct?

Strictly speaking, yes. It's correct for all cases in which you should use the 
function. The problem is the set of cases where it shouldn't be used.

We can easily add text about Windows, explaining that you shouldn't use it in 
the first place. It will work and DTRT in most cases, but it may have data 
loss with non-representable file names.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list