From koffice-devel Tue Jul 31 12:20:15 2001 From: Nicolas Goutte Date: Tue, 31 Jul 2001 12:20:15 +0000 To: koffice-devel Subject: Re: [PATCH] KSpread/HTML: dialog for choosing encoding X-MARC-Message: https://marc.info/?l=koffice-devel&m=99658225315719 On Tuesday, 31. July 2001 08:43, Lukas Tinkl wrote: > Dne út 31. červenec 2001 00:37 Nicolas Goutte napsal(a): > > Okay, there is a patch to let the user choose between UTF-8 and local > > encoding when exporting HTML from KSpread. > > > > In the attached file kspreadhtml.tar.bz2, there are 4 files: 3 new files > > and the diff to the existant files. Everything is for the directory > > "filter/kspread/html". > > > > Known problems: the encoding of the file is not written as a tag > > if not in UTF-8. I am still trying to find the best way to do that > > correctly. > > > > And sorry to not have a plain text attachement, but I do not know how > > long an email can be on koffice-devel. > > > > Have a nice day/evening/night! > > This is how I did it in the HTML export in Kpresenter, it's simple: :) > > QFont::CharSet chset = KGlobal::charsets()->charsetForLocale(); > QString chsetName = KGlobal::charsets()->name(chset); No, sorry, as I have already written yesterday to David Faure and to KOffice-devel is that KCharsets::name does not give the right name for non-ISO-8859 encodings. The encodings must have IANA names ( http://www.iana.org/assignments/character-sets ) and there are different from what KCharsets::name() and QTextCodec::name() give. As example I had given "EUC-JP", which is "eucjp" for KCharsets::name(). > > QString html; > for ( unsigned int i = 0; i < slideInfos.count(); i++ ) { > pgNum = i + 1; > html = QString( " Transitional//EN\">" ); > html += QString( "%1 - %2\n" ).arg( title > ).arg( slideInfos[ i ] > html += QString( " CONTENT=\"text/html; charset=%1\">\n" ).arg( chsetName ); Have a nice day/evening/night! _______________________________________________ Koffice-devel mailing list Koffice-devel@master.kde.org http://master.kde.org/mailman/listinfo/koffice-devel