[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:       Toshitaka Fujioka <toshitaka () kde ! gr ! jp>
Date:       2001-08-01 9:12:45
[Download RAW message or body]

On Tuesday 31 July 2001 21:20, Nicolas Goutte wrote:
> 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().

I tested 
 <META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
 <META http-equiv="Content-Type" content="text/html; charset=eucjp">
 <META http-equiv="Content-Type" content="text/html; charset=euc-jp">
with Konqueror, Mozilla and Netscape 4.76. Japanese was displayed.

I think that it work fine with
    QString charsetName;
    if (utf8)
        charsetName = "UTF-8";
    else
        charsetName = QTextCodec::codecForLocale()->name();

    str += QString( "<meta http-equiv=\"Content-Type\" "content=\"text/html; \
                charset=%1\">\n" ).arg( charsetName );
.

Thank you.
-- 
Toshitaka Fujioka
http://www.kde.org                The K Desktop Environment Project
                                                    fujioka@kde.org
http://www.kde.gr.jp               Japan KDE User's Group
                                                    toshitaka@kde.gr.jp

-- We offer the best Desktop Environment to you.  (This is my goal. ;-)) --     

_______________________________________________
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