[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] KSpread/HTML: dialog for choosing encoding
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2001-07-31 12:20:15
[Download RAW message or body]

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 <meta> 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( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0
> Transitional//EN\">" );
>     html += QString( "<HTML><HEAD><TITLE>%1 - %2</TITLE>\n" ).arg( title
> ).arg( slideInfos[ i ]
>     html += QString( "<META HTTP-Equiv=\"Content-Type\"
> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic