From aac3c51c551f16687490a0c8e3f2a70357642b74 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Fri, 6 Jan 2023 06:32:51 -0700 Subject: [PATCH] remove encoding, fixed encoding data from formats. (#973) --- brauniger_iq.cc | 5 +++-- defs.h | 10 ---------- dg-100.h | 10 ---------- exif.h | 12 +----------- format.h | 2 -- format_skeleton.cc | 5 +---- garmin.cc | 9 ++++----- garmin_fit.h | 10 ---------- garmin_gpi.h | 12 +----------- garmin_txt.cc | 22 +++++++++++----------- garmin_xt.cc | 7 ++++--- gdb.h | 13 +------------ geo.cc | 1 - geojson.h | 10 ---------- globalsat_sport.h | 10 ---------- gpssim.cc | 3 +-- gpx.h | 10 ---------- gtm.cc | 1 - gtrnctr.h | 12 +----------- holux.cc | 3 +-- html.h | 10 ---------- humminbird.h | 22 +--------------------- igc.cc | 3 +-- kml.h | 10 ---------- legacyformat.h | 9 --------- lowranceusr.h | 10 ---------- mtk_logger.cc | 24 ++++++++++++++---------- navilink.cc | 3 +-- nmea.h | 10 ---------- osm.h | 10 ---------- ozi.cc | 3 +-- qstarz_bl_1000.h | 12 +----------- random.h | 10 ---------- sbn.cc | 9 +++++---- sbp.cc | 7 ++++--- shape.h | 12 +----------- skytraq.h | 32 +------------------------------- subrip.h | 10 ---------- text.h | 10 ---------- tpg.cc | 3 +-- tpo.cc | 6 ++---- unicsv.h | 10 ---------- v900.cc | 3 ++- vcf.cc | 3 +-- wbt-200.cc | 10 ++++++---- xcsv.h | 10 ---------- 46 files changed, 71 insertions(+), 357 deletions(-) diff --git a/brauniger_iq.cc b/brauniger_iq.cc index 7074caac2..371096779 100644 --- a/brauniger_iq.cc +++ b/brauniger_iq.cc @@ -263,6 +263,8 @@ static void data_read() static QVector brauniger_iq_args = { }; +/* master process: don't convert anything */ + ff_vecs_t brauniger_iq_vecs = { ff_type_serial, { ff_cap_none, ff_cap_read, ff_cap_none}, @@ -274,6 +276,5 @@ ff_vecs_t brauniger_iq_vecs = { nullptr, nullptr, &brauniger_iq_args, - CET_CHARSET_UTF8, 1 /* master process: don't convert anything | CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/defs.h b/defs.h index c56bb162d..feba72f4c 100644 --- a/defs.h +++ b/defs.h @@ -927,8 +927,6 @@ struct ff_vecs_t { ff_write write; ff_exit exit; QVector* args; - QString encode; - int fixed_encode; position_ops_t position_ops; }; @@ -988,14 +986,6 @@ QString pretty_deg_format(double lat, double lon, char fmt, const char* sep, boo QString get_filename(const QString& fname); /* extract the filename portion */ -/* - * Character encoding transformations. - */ - -#define CET_CHARSET_ASCII "US-ASCII" -#define CET_CHARSET_UTF8 "UTF-8" -#define CET_CHARSET_MS_ANSI "windows-1252" - /* this lives in gpx.c */ gpsbabel::DateTime xml_parse_time(const QString& dateTimeString); diff --git a/dg-100.h b/dg-100.h index 7d471477d..7e3b5f438 100644 --- a/dg-100.h +++ b/dg-100.h @@ -62,16 +62,6 @@ class Dg100Format : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void read() override; void rd_deinit() override; diff --git a/exif.h b/exif.h index ee50de1de..86a83ed29 100644 --- a/exif.h +++ b/exif.h @@ -46,7 +46,7 @@ #include // for uint32_t, uint16_t, uint8_t, int16_t, int32_t -#include "defs.h" // for arglist_t, ff_cap, Waypoint, ARG_NOMINMAX, ARGTYPE_BOOL, ff_cap_none, ARGTYPE_INT, ARGTYPE_STRING, CET_CHARSET_UTF8, ff_cap_read, ff_cap_write, ff_type, ff_type_file +#include "defs.h" // for arglist_t, ff_cap, Waypoint, ARG_NOMINMAX, ARGTYPE_BOOL, ff_cap_none, ARGTYPE_INT, ARGTYPE_STRING, ff_cap_read, ff_cap_write, ff_type, ff_type_file #include "format.h" // for Format #include "gbfile.h" // for gbfile, gbsize_t @@ -73,16 +73,6 @@ class ExifFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/format.h b/format.h index 229e00620..3774c59e8 100644 --- a/format.h +++ b/format.h @@ -168,8 +168,6 @@ class Format virtual ff_type get_type() const = 0; virtual QVector get_cap() const = 0; - virtual QString get_encode() const = 0; - virtual int get_fixed_encode() const = 0; QString get_name() const { diff --git a/format_skeleton.cc b/format_skeleton.cc index e84f36e5a..07e33f9d6 100644 --- a/format_skeleton.cc +++ b/format_skeleton.cc @@ -148,10 +148,7 @@ ff_vecs_t format_skeleton_vecs = { format_skeleton_write, format_skeleton_exit, &format_skeleton_args, - CET_CHARSET_ASCII, 0, /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ - NULL_POS_OPS, // Unless you do realtime positioning - nullptr // name. Not used by modules. + NULL_POS_OPS // Unless you do realtime positioning }; /**************************************************************************/ diff --git a/garmin.cc b/garmin.cc index 0b1ba3b87..cac9428b6 100644 --- a/garmin.cc +++ b/garmin.cc @@ -141,7 +141,7 @@ static void rw_init(const QString& fname) { receiver_must_upper = 1; - const char* receiver_charset = CET_CHARSET_ASCII; + const char* receiver_charset = "US-ASCII"; if (!mkshort_handle) { mkshort_handle = mkshort_new_handle(); @@ -268,7 +268,7 @@ rw_init(const QString& fname) snwhiteopt = xstrdup("1"); receiver_must_upper = 0; /* This might be 8859-1 */ - receiver_charset = CET_CHARSET_MS_ANSI; + receiver_charset = "windows-1252"; break; case 291: /* GPSMAP 60CS, probably others */ case 1095: /* GPS 72H */ @@ -280,7 +280,7 @@ rw_init(const QString& fname) case 463: /* Quest 2 */ receiver_must_upper = 0; receiver_short_length = 30; - receiver_charset = CET_CHARSET_MS_ANSI; + receiver_charset = "windows-1252"; break; case 577: // Rino 530HCx Version 2.50 receiver_must_upper = 0; @@ -288,7 +288,7 @@ rw_init(const QString& fname) break; case 429: // Streetpilot i3 receiver_must_upper = 0; - receiver_charset = CET_CHARSET_MS_ANSI; + receiver_charset = "windows-1252"; receiver_short_length = 30; break; case 484: // Forerunner 305 @@ -1167,7 +1167,6 @@ ff_vecs_t garmin_vecs = { data_write, nullptr, &garmin_args, - CET_CHARSET_ASCII, 0, { pvt_init, pvt_read, rw_deinit, nullptr, nullptr, nullptr } }; diff --git a/garmin_fit.h b/garmin_fit.h index ed580f80b..fc943ecfe 100644 --- a/garmin_fit.h +++ b/garmin_fit.h @@ -64,16 +64,6 @@ class GarminFitFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/garmin_gpi.h b/garmin_gpi.h index a339d0e8b..d13920184 100644 --- a/garmin_gpi.h +++ b/garmin_gpi.h @@ -55,7 +55,7 @@ #include // for int32_t, int16_t, uint16_t #include // for time_t -#include "defs.h" // for arglist_t, ARG_NOMINMAX, ff_cap, Waypoint, ARGTYPE_BOOL, ARGTYPE_STRING, ff_cap_none, ARGTYPE_FILE, ARGTYPE_INT, CET_CHARSET_MS_ANSI, bounds, ff_cap_read, ff_cap_write, ff_type, ff_type_file, short_handle +#include "defs.h" // for arglist_t, ARG_NOMINMAX, ff_cap, Waypoint, ARGTYPE_BOOL, ARGTYPE_STRING, ff_cap_none, ARGTYPE_FILE, ARGTYPE_INT, bounds, ff_cap_read, ff_cap_write, ff_type, ff_type_file, short_handle #include "format.h" // for Format #include "garmin_fs.h" // for garmin_fs_t #include "gbfile.h" // for gbfile @@ -83,16 +83,6 @@ class GarminGPIFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_MS_ANSI; /* WIN-CP1252 */ - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/garmin_txt.cc b/garmin_txt.cc index 1f102763c..e544a2907 100644 --- a/garmin_txt.cc +++ b/garmin_txt.cc @@ -745,7 +745,7 @@ garmin_txt_wr_init(const QString& fname) memset(>xt_flags, 0, sizeof(gtxt_flags)); fout = new gpsbabel::TextStream; - fout->open(fname, QIODevice::WriteOnly, MYNAME, "Windows-1252"); + fout->open(fname, QIODevice::WriteOnly, MYNAME, "windows-1252"); gtxt_flags.metric = (toupper(*get_option_val(opt_dist, "m")) == 'M'); gtxt_flags.celsius = (toupper(*get_option_val(opt_temp, "c")) == 'C'); @@ -1348,7 +1348,7 @@ garmin_txt_rd_init(const QString& fname) memset(>xt_flags, 0, sizeof(gtxt_flags)); fin = new gpsbabel::TextStream; - fin->open(fname, QIODevice::ReadOnly, MYNAME, "Windows-1252"); + fin->open(fname, QIODevice::ReadOnly, MYNAME, "windows-1252"); memset(&header_ct, 0, sizeof(header_ct)); datum_index = -1; @@ -1415,6 +1415,14 @@ garmin_txt_read() } } +/* + * The file encoding is windows-1252. + * Conversion between windows-1252 and utf-16 is handled by the stream. + * Conversion between utf-16 and utf-8 is handled by this format. + * Let main know char strings have already been converted to utf-8 + * so it doesn't attempt to re-convert any char strings including gmsd data. + */ + ff_vecs_t garmin_txt_vecs = { ff_type_file, FF_CAP_RW_ALL, @@ -1426,15 +1434,7 @@ ff_vecs_t garmin_txt_vecs = { garmin_txt_write, nullptr, &garmin_txt_args, - /* - * The file encoding is Windows-1252, a.k.a CET_CHARSET_MS_ANSI. - * Conversion between Windows-1252 and utf-16 is handled by the stream. - * Conversion between utf-16 and utf-8 is handled by this format. - * Let main know char strings have already been converted to utf-8 - * so it doesn't attempt to re-convert any char strings including gmsd data. - */ - CET_CHARSET_UTF8, 0 - , NULL_POS_OPS + NULL_POS_OPS }; #endif // CSVFMTS_ENABLED diff --git a/garmin_xt.cc b/garmin_xt.cc index 6c179f74f..5e62af4db 100644 --- a/garmin_xt.cc +++ b/garmin_xt.cc @@ -406,6 +406,9 @@ format_garmin_xt_read() /**************************************************************************/ +/* ascii is the expected character set */ +/* not fixed, can be changed through command line parameter */ + ff_vecs_t format_garmin_xt_vecs = { ff_type_file, { @@ -421,8 +424,6 @@ ff_vecs_t format_garmin_xt_vecs = { nullptr, nullptr, &format_garmin_xt_args, - CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ - , NULL_POS_OPS + NULL_POS_OPS }; /**************************************************************************/ diff --git a/gdb.h b/gdb.h index 5a30783b8..f8691230e 100644 --- a/gdb.h +++ b/gdb.h @@ -30,7 +30,7 @@ #include // for QString #include // for QVector -#include "defs.h" // for arglist_t, Waypoint, route_head, ARGTYPE_BOOL, ARGTYPE_INT, ARG_NOMINMAX, bounds, CET_CHARSET_MS_ANSI, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file, short_handle +#include "defs.h" // for arglist_t, Waypoint, route_head, ARGTYPE_BOOL, ARGTYPE_INT, ARG_NOMINMAX, bounds, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file, short_handle #include "format.h" // for Format #include "garmin_fs.h" // for garmin_fs_t #include "garmin_tables.h" // for gt_waypt_classes_e @@ -55,17 +55,6 @@ class GdbFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_MS_ANSI; - } - - int get_fixed_encode() const override - { - /* O.K.: changed to NON-FIXED because of utf8 strings since GDB V3 */ - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/geo.cc b/geo.cc index cc435e3cb..4144cf036 100644 --- a/geo.cc +++ b/geo.cc @@ -276,6 +276,5 @@ ff_vecs_t geo_vecs = { geo_write, nullptr, &geo_args, - CET_CHARSET_UTF8, 0, /* CET-REVIEW */ NULL_POS_OPS }; diff --git a/geojson.h b/geojson.h index ec2439595..bcb9b20a7 100644 --- a/geojson.h +++ b/geojson.h @@ -48,16 +48,6 @@ class GeoJsonFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/globalsat_sport.h b/globalsat_sport.h index 9200bbe25..6a2586f36 100644 --- a/globalsat_sport.h +++ b/globalsat_sport.h @@ -70,16 +70,6 @@ class GlobalsatSportFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/gpssim.cc b/gpssim.cc index a599a8ff6..86865f442 100644 --- a/gpssim.cc +++ b/gpssim.cc @@ -197,6 +197,5 @@ ff_vecs_t gpssim_vecs = { gpssim_write, nullptr, &gpssim_args, - CET_CHARSET_ASCII, 0 - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/gpx.h b/gpx.h index 98bcf8729..7248758f8 100644 --- a/gpx.h +++ b/gpx.h @@ -57,16 +57,6 @@ class GpxFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/gtm.cc b/gtm.cc index 2a0a71c33..9460737d9 100644 --- a/gtm.cc +++ b/gtm.cc @@ -737,6 +737,5 @@ ff_vecs_t gtm_vecs = { gtm_write, nullptr, >m_args, - CET_CHARSET_ASCII, 0, /* CET-REVIEW */ NULL_POS_OPS }; diff --git a/gtrnctr.h b/gtrnctr.h index 1971e7a04..8556f1c50 100644 --- a/gtrnctr.h +++ b/gtrnctr.h @@ -31,7 +31,7 @@ #include // for QVector #include // for QXmlStreamAttributes -#include "defs.h" // for arglist_t, ff_cap, route_head, Waypoint, computed_trkdata, ARG_NOMINMAX, ff_cap_read, ARGTYPE_BOOL, ARGTYPE_STRING, CET_CHARSET_ASCII, ff_cap_none, ff_cap_write, ff_type, ff_type_file +#include "defs.h" // for arglist_t, ff_cap, route_head, Waypoint, computed_trkdata, ARG_NOMINMAX, ff_cap_read, ARGTYPE_BOOL, ARGTYPE_STRING, ff_cap_none, ff_cap_write, ff_type, ff_type_file #include "format.h" // for Format #include "gbfile.h" // for gbfile #include "src/core/datetime.h" // for DateTime @@ -60,16 +60,6 @@ class GtrnctrFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/holux.cc b/holux.cc index b72b5c0bf..3a202f35f 100644 --- a/holux.cc +++ b/holux.cc @@ -306,6 +306,5 @@ ff_vecs_t holux_vecs = { data_write, nullptr, nullptr, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/html.h b/html.h index 86e16ada4..87ba8c0a9 100644 --- a/html.h +++ b/html.h @@ -48,16 +48,6 @@ class HtmlFormat : public Format return { ff_cap_write, ff_cap_none, ff_cap_none }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void wr_init(const QString& fname) override; void write() override; void wr_deinit() override; diff --git a/humminbird.h b/humminbird.h index 00b59da7f..9e7a43bdc 100644 --- a/humminbird.h +++ b/humminbird.h @@ -27,7 +27,7 @@ #include // for int32_t, uint32_t -#include "defs.h" // for ff_cap, arglist_t, ff_cap_read, Waypoint, route_head, ff_cap_write, short_handle, CET_CHARSET_ASCII, ff_type, ff_type_file +#include "defs.h" // for ff_cap, arglist_t, ff_cap_read, Waypoint, route_head, ff_cap_write, short_handle, ff_type, ff_type_file #include "format.h" // for Format #include "gbfile.h" // for gbfile @@ -136,16 +136,6 @@ class HumminbirdFormat : public Format, private HumminbirdBase }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override {humminbird_rd_init(fname);} void read() override {humminbird_read();} void rd_deinit() override {humminbird_rd_deinit();} @@ -190,16 +180,6 @@ class HumminbirdHTFormat : public Format, private HumminbirdBase }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override {humminbird_rd_init(fname);} void read() override {humminbird_read();} void rd_deinit() override {humminbird_rd_deinit();} diff --git a/igc.cc b/igc.cc index 44a187405..b9e3e006e 100644 --- a/igc.cc +++ b/igc.cc @@ -940,6 +940,5 @@ ff_vecs_t igc_vecs = { data_write, nullptr, &igc_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/kml.h b/kml.h index 4d9b92296..3eec80157 100644 --- a/kml.h +++ b/kml.h @@ -56,16 +56,6 @@ class KmlFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/legacyformat.h b/legacyformat.h index f0c752730..2ce92594c 100644 --- a/legacyformat.h +++ b/legacyformat.h @@ -146,15 +146,6 @@ class LegacyFormat : public Format { return vec.cap; } - QString get_encode() const override - { - return vec.encode; - } - - int get_fixed_encode() const override - { - return vec.fixed_encode; - } private: ff_vecs_t vec; diff --git a/lowranceusr.h b/lowranceusr.h index c42bc3b88..605c12bd5 100644 --- a/lowranceusr.h +++ b/lowranceusr.h @@ -124,16 +124,6 @@ class LowranceusrFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/mtk_logger.cc b/mtk_logger.cc index fdb014782..d94b47854 100644 --- a/mtk_logger.cc +++ b/mtk_logger.cc @@ -1655,6 +1655,9 @@ static void file_read() // GPS logger will only handle tracks - neither waypoints or tracks... // Actually, some of the Holux devices will read waypoints. +/* ascii is the expected character set */ +/* not fixed, can be changed through command line parameter */ + ff_vecs_t mtk_vecs = { ff_type_serial, { @@ -1670,11 +1673,12 @@ ff_vecs_t mtk_vecs = { nullptr, nullptr, &mtk_sargs, - CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ - , NULL_POS_OPS + NULL_POS_OPS }; +/* ascii is the expected character set */ +/* not fixed, can be changed through command line parameter */ + ff_vecs_t mtk_m241_vecs = { ff_type_serial, { @@ -1690,9 +1694,7 @@ ff_vecs_t mtk_m241_vecs = { nullptr, nullptr, &mtk_sargs, - CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ - , NULL_POS_OPS + NULL_POS_OPS }; /* used for mtk-bin */ @@ -1704,6 +1706,8 @@ static QVector mtk_fargs = { }, }; +/* master process: don't convert anything */ + ff_vecs_t mtk_fvecs = { ff_type_file, { ff_cap_read, ff_cap_read, ff_cap_none }, @@ -1715,10 +1719,11 @@ ff_vecs_t mtk_fvecs = { nullptr, nullptr, &mtk_fargs, - CET_CHARSET_UTF8, 1 /* master process: don't convert anything | CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; +/* master process: don't convert anything */ + ff_vecs_t mtk_m241_fvecs = { ff_type_file, { ff_cap_read, ff_cap_read, ff_cap_none }, @@ -1730,8 +1735,7 @@ ff_vecs_t mtk_m241_fvecs = { nullptr, nullptr, &mtk_fargs, - CET_CHARSET_UTF8, 1 /* master process: don't convert anything | CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; /* End file: mtk_logger.c */ /**************************************************************************/ diff --git a/navilink.cc b/navilink.cc index 4ddf6189c..49e61f920 100644 --- a/navilink.cc +++ b/navilink.cc @@ -1223,6 +1223,5 @@ ff_vecs_t navilink_vecs = { navilink_write, nullptr, &navilink_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/nmea.h b/nmea.h index e0f3a679d..d612abdbb 100644 --- a/nmea.h +++ b/nmea.h @@ -59,16 +59,6 @@ class NmeaFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/osm.h b/osm.h index 5e4f5bafe..87590b45b 100644 --- a/osm.h +++ b/osm.h @@ -60,16 +60,6 @@ class OsmFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/ozi.cc b/ozi.cc index 3bb429898..c6d01622d 100644 --- a/ozi.cc +++ b/ozi.cc @@ -970,6 +970,5 @@ ff_vecs_t ozi_vecs = { data_write, nullptr, &ozi_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/qstarz_bl_1000.h b/qstarz_bl_1000.h index b251efb51..2870407e9 100644 --- a/qstarz_bl_1000.h +++ b/qstarz_bl_1000.h @@ -31,7 +31,7 @@ #include // for QVector #include // for qint8, quint16, quint8 -#include "defs.h" // for ff_cap, ff_cap_read, ff_cap_none, CET_CHARSET_ASCII, ff_type, ff_type_file, route_head +#include "defs.h" // for ff_cap, ff_cap_read, ff_cap_none, ff_type, ff_type_file, route_head #include "format.h" // for Format #include "formspec.h" // for FormatSpecificData, kFsQstarzBl1000 @@ -69,16 +69,6 @@ class QstarzBL1000Format : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/random.h b/random.h index 53e5dd25d..3f392e3bd 100644 --- a/random.h +++ b/random.h @@ -54,16 +54,6 @@ class RandomFormat : public Format }; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/sbn.cc b/sbn.cc index 8d81b9f49..735f87a07 100644 --- a/sbn.cc +++ b/sbn.cc @@ -309,6 +309,10 @@ sbn_read() /**********************************************************************/ +/* Characters are always encoded in ASCII. Even if the unit is set + * to Chinese language, only ASCII characters can be entered. + */ + ff_vecs_t sbn_vecs = { ff_type_file, { @@ -324,9 +328,6 @@ ff_vecs_t sbn_vecs = { nullptr, nullptr, &sbn_args, - /* Characters are always encoded in ASCII. Even if the unit is set - * to Chinese language, only ASCII characters can be entered. */ - CET_CHARSET_ASCII, 0 - , NULL_POS_OPS + NULL_POS_OPS }; /**********************************************************************/ diff --git a/sbp.cc b/sbp.cc index 6f9ccd24b..e9907132c 100644 --- a/sbp.cc +++ b/sbp.cc @@ -117,6 +117,9 @@ sbp_read() /**************************************************************************/ +/* ascii is the expected character set */ +/* not fixed, can be changed through command line parameter */ + ff_vecs_t sbp_vecs = { ff_type_file, { @@ -132,8 +135,6 @@ ff_vecs_t sbp_vecs = { nullptr, nullptr, &sbp_args, - CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ - , NULL_POS_OPS + NULL_POS_OPS }; /**************************************************************************/ diff --git a/shape.h b/shape.h index 4832d7d70..3d1c0b9f1 100644 --- a/shape.h +++ b/shape.h @@ -25,7 +25,7 @@ #include // for QString #include // for QVector -#include "defs.h" // for arglist_t, ARGTYPE_STRING, Waypoint, route_head, CET_CHARSET_ASCII, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file +#include "defs.h" // for arglist_t, ARGTYPE_STRING, Waypoint, route_head, FF_CAP_RW_ALL, ff_cap, ff_type, ff_type_file #include "format.h" // for Format #if SHAPELIB_ENABLED #if HAVE_LIBSHAPE @@ -53,16 +53,6 @@ class ShapeFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/skytraq.h b/skytraq.h index e8ae07a7b..d7d6fe76b 100644 --- a/skytraq.h +++ b/skytraq.h @@ -31,7 +31,7 @@ #include // for uint8_t, int32_t, uint32_t, uint16_t, int16_t #include // for time_t -#include "defs.h" // for arglist_t, ARGTYPE_INT, ff_cap, ARG_NOMINMAX, ARGTYPE_STRING, ff_cap_read, ARGTYPE_BOOL, CET_CHARSET_UTF8, ff_cap_none, ff_type, ARGTYPE_OUTFILE, ff_type_serial, Waypoint, ff_type_file, route_head +#include "defs.h" // for arglist_t, ARGTYPE_INT, ff_cap, ARG_NOMINMAX, ARGTYPE_STRING, ff_cap_read, ARGTYPE_BOOL, ff_cap_none, ff_type, ARGTYPE_OUTFILE, ff_type_serial, Waypoint, ff_type_file, route_head #include "format.h" // for Format #include "gbfile.h" // for gbfile @@ -182,16 +182,6 @@ class SkytraqFormat : public Format, private SkytraqBase return { ff_cap_read, ff_cap_read, ff_cap_none }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override {skytraq_rd_init(fname);} void read() override {skytraq_read();} void rd_deinit() override {skytraq_rd_deinit();} @@ -270,16 +260,6 @@ class SkytraqfileFormat : public Format, private SkytraqBase return { ff_cap_read, ff_cap_read, ff_cap_none }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; @@ -336,16 +316,6 @@ class MinihomerFormat : public Format, private SkytraqBase return { ff_cap_read, ff_cap_read, ff_cap_none }; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 1; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/subrip.h b/subrip.h index e54ebee99..5a43ae374 100644 --- a/subrip.h +++ b/subrip.h @@ -50,16 +50,6 @@ class SubripFormat : public Format return { ff_cap_none, ff_cap_write, ff_cap_none }; // waypoints, track, route; for now, we just do tracks } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void wr_init(const QString& fname) override; void write() override; void wr_deinit() override; diff --git a/text.h b/text.h index e280ec676..3305a92b0 100644 --- a/text.h +++ b/text.h @@ -48,16 +48,6 @@ class TextFormat : public Format return { ff_cap_write, ff_cap_none, ff_cap_none}; } - QString get_encode() const override - { - return CET_CHARSET_ASCII; - } - - int get_fixed_encode() const override - { - return 0; - } - void wr_init(const QString& fname) override; void write() override; void wr_deinit() override; diff --git a/tpg.cc b/tpg.cc index 66ed4792b..4e1e337ba 100644 --- a/tpg.cc +++ b/tpg.cc @@ -320,6 +320,5 @@ ff_vecs_t tpg_vecs = { tpg_write, nullptr, &tpg_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/tpo.cc b/tpo.cc index f37fdd44a..ee511c6cc 100644 --- a/tpo.cc +++ b/tpo.cc @@ -2114,8 +2114,7 @@ ff_vecs_t tpo2_vecs = { #endif nullptr, &tpo2_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; /* TPO 3.x format can read waypoints/tracks/routes */ @@ -2130,6 +2129,5 @@ ff_vecs_t tpo3_vecs = { nullptr, nullptr, &tpo3_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/unicsv.h b/unicsv.h index 08dfa4466..f2922ff19 100644 --- a/unicsv.h +++ b/unicsv.h @@ -52,16 +52,6 @@ class UnicsvFormat : public Format return FF_CAP_RW_ALL; } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override; diff --git a/v900.cc b/v900.cc index f008cbef5..d244a3045 100644 --- a/v900.cc +++ b/v900.cc @@ -364,6 +364,8 @@ v900_read() } } +/* Could be US-ASCII, since we only read "0-9,A-Z\n\r" */ + ff_vecs_t v900_vecs = { ff_type_file, {ff_cap_read, ff_cap_read, ff_cap_none}, /* Read only format. May only read trackpoints and waypoints. */ @@ -375,6 +377,5 @@ ff_vecs_t v900_vecs = { nullptr, /* write */ nullptr, nullptr, /* args */ - CET_CHARSET_UTF8, 1, /* Could be US-ASCII, since we only read "0-9,A-Z\n\r" */ {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr} }; diff --git a/vcf.cc b/vcf.cc index fcc616eb0..ee48acbdf 100644 --- a/vcf.cc +++ b/vcf.cc @@ -148,6 +148,5 @@ ff_vecs_t vcf_vecs = { data_write, nullptr, &vcf_args, - CET_CHARSET_ASCII, 0 /* CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/wbt-200.cc b/wbt-200.cc index 1324786be..eeb6c435b 100644 --- a/wbt-200.cc +++ b/wbt-200.cc @@ -1073,6 +1073,8 @@ static QVector wbt_sargs = { }, }; +/* master process: don't convert anything */ + ff_vecs_t wbt_svecs = { ff_type_serial, { ff_cap_read, ff_cap_read, ff_cap_none }, @@ -1084,8 +1086,7 @@ ff_vecs_t wbt_svecs = { nullptr, nullptr, &wbt_sargs, - CET_CHARSET_UTF8, 1 /* master process: don't convert anything | CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; /* used for wbt-bin /and/ wbt-tk1 */ @@ -1093,6 +1094,8 @@ ff_vecs_t wbt_svecs = { static QVector wbt_fargs = { }; +/* master process: don't convert anything */ + ff_vecs_t wbt_fvecs = { ff_type_file, { ff_cap_none, ff_cap_read, ff_cap_none }, @@ -1104,6 +1107,5 @@ ff_vecs_t wbt_fvecs = { nullptr, nullptr, &wbt_fargs, - CET_CHARSET_UTF8, 1 /* master process: don't convert anything | CET-REVIEW */ - , NULL_POS_OPS + NULL_POS_OPS }; diff --git a/xcsv.h b/xcsv.h index e4bc620b7..c3f55eaf6 100644 --- a/xcsv.h +++ b/xcsv.h @@ -278,16 +278,6 @@ class XcsvFormat : public Format return FF_CAP_RW_WPT; /* This is a bit of a lie for now... */ } - QString get_encode() const override - { - return CET_CHARSET_UTF8; - } - - int get_fixed_encode() const override - { - return 0; - } - void rd_init(const QString& fname) override; void read() override; void rd_deinit() override;