diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-06-23 09:36:03 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-06-23 09:44:08 (GMT) |
commit | 29f5f6eeae00fc0890a171398f6717bc543dff38 (patch) | |
tree | b5d810486f1dbb169217e752f86b490e4f7036bb /tools/linguist/lconvert | |
parent | 59725e0074541ae18868cc9a9922f8a2e1a8b8df (diff) | |
download | Qt-29f5f6eeae00fc0890a171398f6717bc543dff38.zip Qt-29f5f6eeae00fc0890a171398f6717bc543dff38.tar.gz Qt-29f5f6eeae00fc0890a171398f6717bc543dff38.tar.bz2 |
add -input-codec option for qm reader
basing the input codec on the locale was broken by design and didn't
really work anyway. so adding this option really is a bugfix, kind of.
Diffstat (limited to 'tools/linguist/lconvert')
-rw-r--r-- | tools/linguist/lconvert/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index 336bf31..ddde578 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -85,6 +85,9 @@ static int usage(const QStringList &args) " -of <outformat>\n" " --output-format <outformat>\n" " Specify output format. See -if.\n\n" + " --input-codec <codec>\n" + " Specify encoding for .qm input files. Default is 'Latin1'.\n" + " UTF-8 is always tried as well, corresponding to the trUtf8() function.\n\n" " --drop-tags <regexp>\n" " Drop named extra tags when writing 'ts' or 'xlf' files.\n" " May be specified repeatedly.\n\n" @@ -136,6 +139,7 @@ int main(int argc, char *argv[]) bool verbose = false; ConversionData cd; + cd.m_codecForSource = "Latin1"; Translator tr; for (int i = 1; i < args.size(); ++i) { @@ -164,6 +168,10 @@ int main(int argc, char *argv[]) if (++i >= args.size()) return usage(args); inFormat = args[i]; + } else if (args[i] == QLatin1String("-input-codec")) { + if (++i >= args.size()) + return usage(args); + cd.m_codecForSource = args[i].toLatin1(); } else if (args[i] == QLatin1String("-drop-tag")) { if (++i >= args.size()) return usage(args); |