From 6f2c114b835c67d870e4588180f96dc9e1a3d05b Mon Sep 17 00:00:00 2001 From: Yves Arrouye Date: Sat, 16 Feb 2002 18:45:11 +0000 Subject: [PATCH] ICU-1220 allows - for -f and -t (same as not giving them). more documentation. changed some error messages. X-SVN-Rev: 7694 --- icu4c/source/extra/uconv/root.txt | 18 +++++++++--------- icu4c/source/extra/uconv/uconv.1.in | 10 +++++++++- icu4c/source/extra/uconv/uconv.cpp | 4 ++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/icu4c/source/extra/uconv/root.txt b/icu4c/source/extra/uconv/root.txt index 194524eed4..3fb339c876 100644 --- a/icu4c/source/extra/uconv/root.txt +++ b/icu4c/source/extra/uconv/root.txt @@ -1,6 +1,6 @@ // -*- Coding: utf-8; -*- [all uconv resource files] // Copyright (c) 2000 IBM, Inc. and Others. -// $Revision: 1.24 $ +// $Revision: 1.25 $ // // Root translation file for uconv messages. // So you want to translate this file??? Great! @@ -87,16 +87,16 @@ root // ICU errors - used by u_wmsg_errorName() - U_USING_FALLBACK_ERROR { "Using fallback data." } - U_USING_DEFAULT_ERROR { "Using default data." } - U_ZERO_ERROR { "No error has occured!" } - U_ILLEGAL_ARGUMENT_ERROR { "Illegal argument!" } + U_USING_FALLBACK_ERROR { "Using fallback data" } + U_USING_DEFAULT_ERROR { "Using default data" } + U_ZERO_ERROR { "No error has occured" } + U_ILLEGAL_ARGUMENT_ERROR { "Illegal argument" } U_MISSING_RESOURCE_ERROR { "A resource was missing" } - U_INVALID_FORMAT_ERROR { "Invalid format." } - U_FILE_ACCESS_ERROR { "Problem accessing that file/object." } - U_INTERNAL_PROGRAM_ERROR { "Internal program error!!" } + U_INVALID_FORMAT_ERROR { "Invalid format" } + U_FILE_ACCESS_ERROR { "Problem accessing that file/object" } + U_INTERNAL_PROGRAM_ERROR { "Internal program error" } U_MESSAGE_PARSE_ERROR { "Parse error on message format" } - U_MEMORY_ALLOCATION_ERROR { "Out of memory!" } + U_MEMORY_ALLOCATION_ERROR { "Out of memory" } U_INDEX_OUTOFBOUNDS_ERROR { "An index was out-of-bounds" } U_PARSE_ERROR { "Parse error" } U_INVALID_CHAR_FOUND { "Invalid character found" } diff --git a/icu4c/source/extra/uconv/uconv.1.in b/icu4c/source/extra/uconv/uconv.1.in index 07231138d1..603225d830 100644 --- a/icu4c/source/extra/uconv/uconv.1.in +++ b/icu4c/source/extra/uconv/uconv.1.in @@ -84,9 +84,17 @@ to another. The transcoding is done using Unicode as a pivot encoding (i.e. the data are first transcoded from their original encoding to Unicode, and then from Unicode to the destination encoding). +.PP If an .I encoding -is not specified, the default encoding is used. +is not specified or is +.BR - , +the default encoding is used. Thus, calling +.B uconv +with no +.I encoding +provides an easy way to validate and sanitize data files for +further consumption by tools requiring data in the default encoding. .PP When calling .BR uconv , diff --git a/icu4c/source/extra/uconv/uconv.cpp b/icu4c/source/extra/uconv/uconv.cpp index 0bd795c4c0..ca588386d3 100644 --- a/icu4c/source/extra/uconv/uconv.cpp +++ b/icu4c/source/extra/uconv/uconv.cpp @@ -885,10 +885,10 @@ int main(int argc, char **argv) return printTransliterators(pname, printCanon) ? 3 : 0; } - if (!fromcpage) { + if (!fromcpage || !uprv_strcmp(fromcpage, "-")) { fromcpage = ucnv_getDefaultName(); } - if (!tocpage) { + if (!tocpage || !uprv_strcmp(tocpage, "-")) { tocpage = ucnv_getDefaultName(); }