summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lconvert
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-17 17:41:23 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-17 17:43:50 (GMT)
commit1185386dfe9727ed591da442e97084907f0a6735 (patch)
treedf4a70d8132e4f2d3005160c68130a2c176e5636 /tools/linguist/lconvert
parent74c0b4300b538b24c56abf2be2d5e09b9c59a845 (diff)
downloadQt-1185386dfe9727ed591da442e97084907f0a6735.zip
Qt-1185386dfe9727ed591da442e97084907f0a6735.tar.gz
Qt-1185386dfe9727ed591da442e97084907f0a6735.tar.bz2
don't rely on system codec when handling PO files
- make -input-codec affect PO files, default to UTF-8 - add -output-codec for PO files, same default
Diffstat (limited to 'tools/linguist/lconvert')
-rw-r--r--tools/linguist/lconvert/main.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp
index 553ce6e..fe8d529 100644
--- a/tools/linguist/lconvert/main.cpp
+++ b/tools/linguist/lconvert/main.cpp
@@ -86,8 +86,11 @@ static int usage(const QStringList &args)
" --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"
+ " Specify encoding for .qm and .po input files. Default is 'Latin1'\n"
+ " for .qm and 'UTF-8' for .po files. UTF-8 is always tried as well for\n"
+ " .qm, corresponding to the possible use of the trUtf8() function.\n\n"
+ " --output-codec <codec>\n"
+ " Specify encoding for .po output files. Default is 'UTF-8'.\n\n"
" --drop-tags <regexp>\n"
" Drop named extra tags when writing 'ts' or 'xlf' files.\n"
" May be specified repeatedly.\n\n"
@@ -139,7 +142,6 @@ 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) {
@@ -172,6 +174,10 @@ int main(int argc, char *argv[])
if (++i >= args.size())
return usage(args);
cd.m_codecForSource = args[i].toLatin1();
+ } else if (args[i] == QLatin1String("-output-codec")) {
+ if (++i >= args.size())
+ return usage(args);
+ cd.m_outputCodec = args[i].toLatin1();
} else if (args[i] == QLatin1String("-drop-tag")) {
if (++i >= args.size())
return usage(args);