Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

excel: utf-8 encoding + open-failure warning on csv export

Jayraj0fdfb03c8cda
diff --git a/fincept-qt/src/screens/excel/ExcelScreen.cpp b/fincept-qt/src/screens/excel/ExcelScreen.cpp
index 37c88c072..a5ba97699 100644
--- a/fincept-qt/src/screens/excel/ExcelScreen.cpp
+++ b/fincept-qt/src/screens/excel/ExcelScreen.cpp
@@ -332,10 +332,14 @@ void ExcelScreen::on_export_csv() {
return;
QFile file(path);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text)){
+ QMessageBox::warning(this, "Export failed", "Could not open file for writing:\n" + path);
+ return;
+ }
return;
QTextStream out(&file);
+ out.setEncoding(QStringConverter::Utf8);
auto cells = sheet->get_data();
// Find the last row/col with data to avoid huge trailing empty rows