comparison lib/unicodeio.c @ 3202:283d780ab032

(print_unicode_char): Simplify accordingly.
author Jim Meyering <jim@meyering.net>
date Tue, 06 Mar 2001 18:11:01 +0000
parents f65bb2158462
children f80e972daf0f
comparison
equal deleted inserted replaced
3201:174d1262dd35 3202:283d780ab032
1 /* Unicode character output to streams with locale dependent encoding. 1 /* Unicode character output to streams with locale dependent encoding.
2 2
3 Copyright (C) 2000 Free Software Foundation, Inc. 3 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify it 5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published 6 under the terms of the GNU Library General Public License as published
7 by the Free Software Foundation; either version 2, or (at your option) 7 by the Free Software Foundation; either version 2, or (at your option)
8 any later version. 8 any later version.
122 if (!initialized) 122 if (!initialized)
123 { 123 {
124 extern const char *locale_charset PARAMS ((void)); 124 extern const char *locale_charset PARAMS ((void));
125 const char *charset = locale_charset (); 125 const char *charset = locale_charset ();
126 126
127 is_utf8 = (charset != NULL && !strcmp (charset, UTF8_NAME)); 127 is_utf8 = !strcmp (charset, UTF8_NAME);
128 #if HAVE_ICONV 128 #if HAVE_ICONV
129 if (!is_utf8) 129 if (!is_utf8)
130 { 130 {
131 utf8_to_local = (charset != NULL 131 utf8_to_local = iconv_open (charset, UTF8_NAME);
132 ? iconv_open (charset, UTF8_NAME)
133 : (iconv_t)(-1));
134 if (utf8_to_local == (iconv_t)(-1)) 132 if (utf8_to_local == (iconv_t)(-1))
135 { 133 {
136 /* For an unknown encoding, assume ASCII. */ 134 /* For an unknown encoding, assume ASCII. */
137 utf8_to_local = iconv_open ("ASCII", UTF8_NAME); 135 utf8_to_local = iconv_open ("ASCII", UTF8_NAME);
138 if (utf8_to_local == (iconv_t)(-1)) 136 if (utf8_to_local == (iconv_t)(-1))