Re: glib/iconv : delayed dependency

At 17:36 14.05.01 -0400, Owen Taylor wrote:
>Hans Breuer <hans breuer org> writes:
>> At 10:47 14.05.01 +0300, Tor Lillqvist wrote:
>> >Hans Breuer writes:
>> > > fail because of a missing iconv.dll. (It is spitting a g_warning
>> > > then.)
>> >
>> >Go ahead and commit, it's seems fine to me.
>> >
>> >I would replace the g_warning() calls if no iconv DLL can be found
>> >with g_error(), though.
>> >
>> IMO a g_error would miss the point. Assuming that even g_convert with
>> iconv may fail (i.e.: because of an unsupported converison) it should
>> be in the responsibility of the app how to handle it. 
>> [... delete sample code]
>If I was maintaining an application, I'd reject code like this.
>A conversion facility that "sometimes" works is useless.
And not handling possible errors would be useless as well ?
Are you suggesting computer programs which "sometimes" work
are useless ?
IMO the code is acceptable because it is used to export data
to another program, which mostly will allow to edit the text
again. Additionally if there is a possibility to detect errors
in the API shouldn't one try to handle them ? 

The g_convert is only "required" because the latest nearly 
stable version of Gtk for win32 (1.3 March 2000) was already 
converted to use utf8 internal, which Dia does not know of
and has no provision to handle because it still uses Gtk-1.2.x
on it's major platform.

And: it is currently the only place where g_iconv is used.

>I would expect g_get_charset() to return the character set for the
>current codepage, and I'd expect g_iconv() to always handle that.
You are right with you analysis but our conclusions are different.
g_iconv() probably will handle it - at least if it is available.

If not - the results will be as useable as before the g_convert()
usage. My suggestion at that time was:

  "simply drop your native language (if it doesn't conform 
   to 7bit asci), while using computers (as we all have 
   learned 10 years ago :)  ..."

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]