summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-08-31 19:48:13 +0200
committerEike Rathke <erack@redhat.com>2021-09-10 16:22:38 +0200
commitaa69f2a176329795fad957ac639329307c146e58 (patch)
treecbd9837a34dbcd38c8df96458d176a4e823d1921
parentef6def16e8d83bd425f3613c19989a409db7eb66 (diff)
tdf#123055 - Start to read unicode text in order to avoid the BOM
Change-Id: Ica5a2e11b4be1764cc94aafe5366197065cf6363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121391 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 2a7bd3d26362..0574130ee993 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -65,6 +65,8 @@ void OFlatTable::fillColumns(const css::lang::Locale& _aLocale)
{
m_bNeedToReadLine = true; // we overwrite m_aCurrentLine, seek the stream, ...
m_pFileStream->Seek(0);
+ // tdf#123055 - start to read unicode text in order to avoid the BOM
+ m_pFileStream->StartReadingUnicodeText(RTL_TEXTENCODING_DONTKNOW);
m_aCurrentLine = QuotedTokenizedString();
bool bRead = true;
@@ -72,7 +74,8 @@ void OFlatTable::fillColumns(const css::lang::Locale& _aLocale)
const bool bHasHeaderLine = pConnection->isHeaderLine();
QuotedTokenizedString aHeaderLine;
- TRowPositionInFile rowPos(0, 0);
+ const sal_Int32 nPos = static_cast<sal_Int32>(m_pFileStream->Tell());
+ TRowPositionInFile rowPos(nPos, nPos);
sal_Int32 rowNum(0);
if ( bHasHeaderLine )
{