[PATCH] Fix UTF8 problems in the divelist

Thiago Macieira thiago at macieira.org
Wed Apr 24 14:25:37 PDT 2013


On quarta-feira, 24 de abril de 2013 22.46.43, subsurface at henrik.synth.no 
wrote:
> +QString fixUtf8(QString str)
> +{
> +       return QString::fromUtf8(str.toAscii().data());
> +}

>                         case DATE:
> -                               retVal = item->diveDateTime();
> +                               retVal = fixUtf8(item->diveDateTime());

Ugh... Any chance we can fix the source of the data instead?

Also, using toAscii() (a function documented not to do what its name says it 
does) usually indicates "I didn't know what encoding was used". This has the 
potential to make things worse.

So, why is diveDateTime() returning something badly encoded?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130424/7f5db077/attachment.sig>


More information about the subsurface mailing list