diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-11-03 17:14:01 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-11-03 21:07:19 +0100 |
commit | b297f7bbfed83f87398231740e910afe6ebfbb97 (patch) | |
tree | a00d6cf4675a5dd01bba21f140197ba130a28114 /sc/qa/unit/bugfix-test.cxx | |
parent | 5d9d0f3c979732ade57b9c4c4960dd030ffdc9f9 (diff) |
tdf#88821: Set the encoding correctly for HTML files with a BOM.
BOM (Byte Order Mark) in the HTML file changed the underlying eSrcEnc
encoding, but did not actually update the rtl_TextToUnicodeConverter hConv.
Subsequent changes of eSrcEnc in SetSrcEncoding() (triggered by
'content="application/xhtml+xml; charset=UTF-8"' in the HTML file) were then
ignored (eSrcEnc was already set to UTF-8), and the parser was happily using the
old (Windows-1250) hConv.
Change-Id: If432d59891d51c6abe3517e325ed73057d0f8610
Diffstat (limited to 'sc/qa/unit/bugfix-test.cxx')
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index 6213593868b2..3968d381af6a 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -87,6 +87,7 @@ public: void testTdf91979(); // void testTdf40110(); void testTdf98657(); + void testTdf88821(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testTdf64229); @@ -96,6 +97,7 @@ public: CPPUNIT_TEST(testTdf91979); // CPPUNIT_TEST(testTdf40110); CPPUNIT_TEST(testTdf98657); + CPPUNIT_TEST(testTdf88821); CPPUNIT_TEST_SUITE_END(); private: uno::Reference<uno::XInterface> m_xCalcComponent; @@ -243,6 +245,16 @@ void ScFiltersTest::testTdf98657() CPPUNIT_ASSERT_EQUAL(double(285.0), rDoc.GetValue(ScAddress(1, 1, 0))); } +void ScFiltersTest::testTdf88821() +{ + ScDocShellRef xDocSh = loadDoc("tdf88821.", FORMAT_HTML); + ScDocument& rDoc = xDocSh->GetDocument(); + + // B2 should be 'Périmètre', not 'Périmètre' + CPPUNIT_ASSERT_EQUAL(OStringToOUString("P\xC3\xA9rim\xC3\xA8tre", RTL_TEXTENCODING_UTF8), rDoc.GetString(1, 1, 0)); + + xDocSh->DoClose(); +} ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) |