This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

making iconv more user friendly


After using the 'iconv' program and noticing that it didn't support the
aliases that he expected, Richard Stallman wrote:

> Another way to make it more user-friendly would be to make the error
> message for an unrecognized coding system state the command for
> displaying a list of recognized ones.  If I had had a way to list the
> recognized coding systems, and I had seen "latin1" in the list, I
> would have tried spelling the name that way.

Here is a patch that implements this suggestion.

2005-02-05  Bruno Haible  <bruno@clisp.org>

	* iconv/iconv_prog.c (main): In case of unsupported encodings, show
	a hint towards "iconv --list".

--- iconv/iconv_prog.c.bak	2003-04-22 15:10:31.000000000 +0200
+++ iconv/iconv_prog.c	2005-02-05 22:13:20.000000000 +0100
@@ -239,26 +239,29 @@
 	      if (from_wrong)
 		{
 		  if (to_wrong)
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("\
 conversion from `%s' and to `%s' are not supported"),
 			   from_pretty, to_pretty);
 		  else
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion from `%s' is not supported"),
 			   from_pretty);
 		}
 	      else
 		{
 		  if (to_wrong)
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion to `%s' is not supported"),
 			   to_pretty);
 		  else
-		    error (EXIT_FAILURE, 0,
+		    error (0, 0,
 			   _("conversion from `%s' to `%s' is not supported"),
 			   from_pretty, to_pretty);
 		}
+	      error (EXIT_FAILURE, 0,
+		     _("\
+try `%s --help' to get the list of supported encodings"));
 	    }
 	  else
 	    error (EXIT_FAILURE, errno,



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]