summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/misc/HtmlReader.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-08-28 14:08:11 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-08-28 14:08:11 +0000
commit135ec0efb312ccf1a10b3a17d33b726eb32df920 (patch)
tree06bf79ab7cfe1c93b20ba15ce0bb2c743cacf9e7 /dbaccess/source/ui/misc/HtmlReader.cxx
parent40976820b9cb5d1e0fdf47a79cf950fcca14e168 (diff)
INTEGRATION: CWS dba205a (1.25.12); FILE MERGED
2006/07/31 09:12:10 oj 1.25.12.1: #i53579# set correct text encoding
Diffstat (limited to 'dbaccess/source/ui/misc/HtmlReader.cxx')
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 52d0cfb7c5fe..18a609e15d14 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: HtmlReader.cxx,v $
*
- * $Revision: 1.25 $
+ * $Revision: 1.26 $
*
- * last change: $Author: hr $ $Date: 2006-06-20 03:20:01 $
+ * last change: $Author: ihi $ $Date: 2006-08-28 15:08:11 $
*
* 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 @@ void OHTMLReader::NextToken( int nToken )
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 @@ void OHTMLReader::setTextEncoding()
{
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;
}
}