From 3d7ab959fb8fe8aec889650b20693ff88907f799 Mon Sep 17 00:00:00 2001 From: Walker Thompson Date: Tue, 27 Jan 2026 17:28:59 +0000 Subject: Fix crash with non-ASCII filenames; change CSV to TSV --- transcode.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'transcode.h') diff --git a/transcode.h b/transcode.h index 204ea0b..6e5e96b 100644 --- a/transcode.h +++ b/transcode.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -32,21 +33,23 @@ static string path_separator = "/"; #ifdef EXTERN_WX_GUI extern void detect_fonts(const char* xmlfile, vector& doc_fonts, vector& 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& doc_fonts, const vector& doc_encs, map>& char_map, vector& 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 & 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& doc_fonts); + const wstring& targ_font, const vector& doc_fonts); extern string random_anum_string(int len); extern void read_config_file(const char* configfile, - map& config_options); + map& config_options); extern void write_config_file(const char* configfile, - map& config_options); + map& 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 config_options; + map 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 convfiles = { "word/footnotes.xml" }; -static const char * styles_xmlfile = "word/styles.xml"; - static const map ascii_utf = { {0x2126, 0x03A9} // Ohm symbol }; -- cgit v1.3