Index: src/fileformats/rtf_writer.cpp
--- src/fileformats/rtf_writer.cpp.orig
+++ src/fileformats/rtf_writer.cpp
@@ -12,6 +12,7 @@
 #include <QTextBlock>
 #include <QTextDocument>
 
+#include <locale.h>
 //-----------------------------------------------------------------------------
 
 bool RtfWriter::write(QIODevice* device, const QTextDocument* text, bool full)
