summaryrefslogtreecommitdiff
path: root/transcode.h
diff options
context:
space:
mode:
authorWalker Thompson <walker.thompson@urz.uni-heidelberg.de>2026-01-27 17:28:59 +0000
committerWalker Thompson <walker.thompson@urz.uni-heidelberg.de>2026-01-27 19:39:34 +0000
commit3d7ab959fb8fe8aec889650b20693ff88907f799 (patch)
treef43d53fe15dffd0d54c87d03aa018a8ff2588c00 /transcode.h
parenta2d7ebcdc396fcaa505251dd1625df34fdd00771 (diff)
Fix crash with non-ASCII filenames; change CSV to TSV
Diffstat (limited to 'transcode.h')
-rw-r--r--transcode.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/transcode.h b/transcode.h
index 204ea0b..6e5e96b 100644
--- a/transcode.h
+++ b/transcode.h
@@ -5,6 +5,7 @@
#include <map>
#include <algorithm>
#include <random>
+#include <locale>
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/fontdlg.h>
@@ -32,21 +33,23 @@ static string path_separator = "/";
#ifdef EXTERN_WX_GUI
extern void detect_fonts(const char* xmlfile, vector<wstring>& doc_fonts,
vector<wstring>& doc_encs);
-extern void process_xml(const char * xmlfile, wstring& targ_font,
+extern void process_xml(const char * xmlfile, const wstring& targ_font,
const vector<wstring>& doc_fonts, const vector<wstring>& doc_encs,
map<wstring, vector<wstring>>& char_map,
vector<wstring>& utf_chars, const wstring& default_font, bool do_greek);
-extern bool to_bool(const wstring& s);
+extern bool to_bool(const string& s);
extern void uniq(vector <wstring>& vec);
extern void get_default_pfont(wstring& default_font,
const char* styles_xmlfile);
extern void update_default_pfont(const char * styles_xmlfile,
- wstring& targ_font, const vector<wstring>& doc_fonts);
+ const wstring& targ_font, const vector<wstring>& doc_fonts);
extern string random_anum_string(int len);
extern void read_config_file(const char* configfile,
- map<wstring, wstring>& config_options);
+ map<string, string>& config_options);
extern void write_config_file(const char* configfile,
- map<wstring, wstring>& config_options);
+ map<string, string>& config_options);
+
+static const char *styles_xmlfile = "word/styles.xml";
#endif
class TranscodeGUI: public wxApp {
@@ -66,7 +69,7 @@ class TranscodeFrame: public wxFrame {
bool do_greek;
bool do_font_select;
} config_params;
- map<wstring, wstring> config_options;
+ map<string, string> config_options;
wxString config_filepath;
wxBoxSizer *infile_sizer;
@@ -76,19 +79,19 @@ class TranscodeFrame: public wxFrame {
void SelectDoc(wxCommandEvent& event);
wxString infile_path;
- wxBoxSizer *csvfile_sizer;
- wxStaticText *csvfile_label;
- wxTextCtrl *csvfile_field;
- wxButton *csvfile_button;
- void SelectCSV(wxCommandEvent& event);
- wxString csvfile_path;
+ wxBoxSizer *tsvfile_sizer;
+ wxStaticText *tsvfile_label;
+ wxTextCtrl *tsvfile_field;
+ wxButton *tsvfile_button;
+ void SelectTSV(wxCommandEvent& event);
+ wxString tsvfile_path;
wxStaticText *fontsel_label;
wxBoxSizer *fontsel_sizer;
wxTextCtrl *fontsel_field;
wxButton *fontsel_button;
void DoFontDialog(wxCommandEvent& event);
- wstring fontsel_name;
+ wxString fontsel_name;
wxCheckBox *check_greek;
void ChkGrk(wxCommandEvent& event);
@@ -122,8 +125,6 @@ static const vector<const char*> convfiles = {
"word/footnotes.xml"
};
-static const char * styles_xmlfile = "word/styles.xml";
-
static const map<const wchar_t, const wchar_t> ascii_utf = {
{0x2126, 0x03A9} // Ohm symbol
};