Tag: cws_src680_dba205a User: oj Date: 2006/07/31 02:12:13 Modified: dba/dbaccess/source/ui/misc/HtmlReader.cxx
Log: #i53579# set correct text encoding File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: HtmlReader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/HtmlReader.cxx?r1=1.25&r2=1.25.12.1 Delta lines: +22 -6 -------------------- --- HtmlReader.cxx 20 Jun 2006 03:20:01 -0000 1.25 +++ HtmlReader.cxx 31 Jul 2006 09:12:10 -0000 1.25.12.1 @@ -4,9 +4,9 @@ * * $RCSfile: HtmlReader.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.25.12.1 $ * - * last change: $Author: hr $ $Date: 2006/06/20 03:20:01 $ + * last change: $Author: oj $ $Date: 2006/07/31 09:12:10 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -41,6 +41,9 @@ #ifndef _CONNECTIVITY_DBTOOLS_HXX_ #include <connectivity/dbtools.hxx> #endif +#ifndef _TOOLS_TENCCVT_HXX +#include <tools/tenccvt.hxx> +#endif #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif @@ -270,13 +273,15 @@ DBG_CHKTHIS(OHTMLReader,NULL); if(m_bError || !m_nRows) // falls Fehler oder keine Rows mehr zur "Uberpr"ufung dann gleich zur"uck return; - if(!m_bMetaOptions) - setTextEncoding(); if(m_xConnection.is()) // gibt an welcher CTOR gerufen wurde und damit, ob eine Tabelle erstellt werden soll { switch(nToken) { + case HTML_META: + if(!m_bMetaOptions) + setTextEncoding(); + break; case HTML_TABLE_ON: ++m_nTableCount; { // es kann auch TD oder TH sein, wenn es vorher kein TABLE gab @@ -702,7 +707,18 @@ { case HTML_META_CONTENT_TYPE: if( aContent.Len() ) - SetSrcEncoding(GetEncodingByMIME( aContent )); + { + rtl_TextEncoding eEnc = GetEncodingByMIME( aContent ); + // If the encoding is set by a META tag, it may only overwrite the + // current encoding if both, the current and the new encoding, are 1-BYTE + // encodings. Everything else cannot lead to reasonable results. + if ( rtl_isOctetTextEncoding( eEnc ) && + rtl_isOctetTextEncoding( GetSrcEncoding() ) ) + { + eEnc = GetExtendedCompatibilityTextEncoding( eEnc ); + SetSrcEncoding( eEnc ); + } + } break; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
