[PATCH] Fix UTF8 problems in the divelist

Dirk Hohndel dirk at hohndel.org
Wed Apr 24 15:17:44 PDT 2013


On Wed, 2013-04-24 at 14:25 -0700, Thiago Macieira wrote:
> 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?

Yeah, I'd rather make sure that what we store in the members is
correctly encoded...

>From that point of view I liked the UTF8 fix in Amit's patch much
better.

/D



More information about the subsurface mailing list