diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 8835b132bf05..b871881e0997 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -90,7 +90,8 @@ bool IsPrintLayoutExtension()
bool IsDefaultTextEncoding()
{
std::optional x = officecfg::Office::Common::Filter::HTML::Export::Encoding::get();
- return bool(x);
+ // if we have a value, then the text encoding is not default
+ return !bool(x);
}
rtl_TextEncoding GetTextEncoding()
{