From e0e86ccb1d2848678b5c32f65bf6239ba5fb9d24 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 29 Nov 2001 05:00:56 +0000 Subject: Update. * iconv/gconv_open.c (__gconv_open): Empty codeset name now means using the current locale's codeset. * iconv/iconv_open.c (iconv_open): Don't strip out everything for empty input string. * iconv/iconv_prog.c: Pass empty strings as default value for to- and from-charset. Don't determine locale's charset here. if libio is used [PR libc/2575]. --- iconv/iconv_prog.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'iconv/iconv_prog.c') diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c index e71f8d7..07296f0 100644 --- a/iconv/iconv_prog.c +++ b/iconv/iconv_prog.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -92,9 +91,11 @@ static struct argp argp = options, parse_opt, args_doc, doc, NULL, more_help }; -/* Code sets to convert from and to respectively. */ -static const char *from_code; -static const char *to_code; +/* Code sets to convert from and to respectively. An empty string as the + default causes the 'iconv_open' function to look up the charset of the + currently selected locale and use it. */ +static const char *from_code = ""; +static const char *to_code = ""; /* File to write output to. If NULL write to stdout. */ static const char *output_file; @@ -141,20 +142,6 @@ main (int argc, char *argv[]) print_known_names (); exit (EXIT_SUCCESS); } - if (from_code == NULL) - { - /* The Unix standard says that in this case the charset of the current - locale is used. */ - from_code = nl_langinfo (CODESET); - assert (from_code != NULL); - } - if (to_code == NULL) - { - /* The Unix standard says that in this case the charset of the current - locale is used. */ - to_code = nl_langinfo (CODESET); - assert (to_code != NULL); - } /* If we have to ignore errors make sure we use the appropriate name for the to-character-set. */ -- cgit v1.1