[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: FTBFS for owncloud-client 2.4.0~beta1+dfsg-1 on kfreebsd - QTextCodec::codecForLocale()



Hi Charsten,

thanks for starting looking into this issue.
 
> Running "LC_ALL=de_DE.UTF-8 wc --help" on a jessie-kfreebsd machine and
> in a sid chroot shows me a german help text.

i made now also some tests on a posterbox and came to the same conclusion, 
that the LC_Settings are correctly applied :D 

I added the Kde/Qt team, because for me it looks like the issue is maybe a Qt 
one and/or the tests are wrong..
I had the same issue for all platforms, but for all expect FreeBSDs ones I 
could solved this issue by setting LC_ALL=C.UTF-8. I also tried de_DE.UTF-8, 
de_DE.utf8 and en_US.UTF-8 etc.

After some back and force i now found the base issue of this. The tests are 
using Qt for converting mbchars <-> QByteArrays and if i request the actual 
QTextCodec::codecForLocale() i get "US_ASCII". If I manualy set the locale via
auto codec = QTextCodec::codecForName("UTF-8");
QTextCodec::setCodecForLocale(codec);

The test are passing. Now the question rises, why is LC_ALL=C.UTF-8 not enough 
to trigger QTextCodec::codecForLocale() to return the correct value?

src/csync/std/c_utf8.cpp:

mbchar_t* c_utf8_string_to_locale(const char *str) {
auto codec = QTextCodec::codecForName("UTF-8"); //Added -> test pases
QTextCodec::setCodecForLocale(codec); //Added -> test pases
return c_strdup(QFile::encodeName(QString::fromUtf8(str)));
}

QByteArray c_utf8_from_locale(const mbchar_t *wstr) {
//auto codec = QTextCodec::codecForLocale(); #returns "US_ASCII"
auto codec = QTextCodec::codecForName("UTF-8"); // added test passes
if (codec->mibEnum() == 106) { // UTF-8
return QByteArray(wstr);
}
}

Best regards,

sandro
--


> I pushed the new owncloud-client beta release (2.4.0~beta1) to experimental 
and unfortunately
> it fails run tests on kfreebsd i386 & amd64 [1,2].
> The ground of the issue is that the console don't support UTF-8.
> I faced the same issue at amd64 I could solve this by set LC_ALL=C.UTF-8.
> It looks like this fix don't help on FreeBSD.
> Have you any idea how I can set the LC setting on FreeBSD?

that's strange, it should work.

Running "LC_ALL=de_DE.UTF-8 wc --help" on a jessie-kfreebsd machine and
in a sid chroot shows me a german help text.

Regards,

Carsten

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: