[Evolution-hackers] Re: [evolution-patches] [Mailer] Possible fix for #333213



Hi Jeffrey and all,

On Fri, 2006-03-03 at 10:00 -0500, Jeffrey Stedfast wrote:
> The patch is bad because callers of e_iconv() expect errno to be set on
> -1 and your patch breaks that guarantee.
> 

Yeah, you're right.:) Instead of changing e_iconv(), can we do more
checking when invoking e_iconv()?

> I would really appreciate seeing the section on iconv in the POSIX.1
> specification explaining what is meant and entailed by "irreversable
> conversion" and also whether this count is maintained thru multiple
> calls to iconv() or not[1].

Post the lastest POSIX.1 specification.
http://www.opengroup.org/onlinepubs/009695399/functions/iconv.html

"non-identical conversation" should be more exact term. It means "a
character in the input buffer that is valid, but for which an identical
character does not exist in the target codeset". 

And the return value is only related to the last call to iconv().

So I think it's necessary to add more checking for return value, i.e. -1
and positive value both mean some problems in conversation. Is that
possible to change like below?

	if ((status == (size_t) -1) || status > (size_t) 0)
                return -1;

Thanks,
-Simon

> 
> that answered, yes, probably we should be checking that the count is not
> > 0 in the composer code and possibly other places in evolution as well.
> 
> 
> 1. say, for example, I call iconv() and my outbuf isn't large enough -
> some conversion has still occured and it has possibly already made some
> "irreversable conversions" but since iconv() will return -1, how do I
> know? After making my nth call to iconv() finishing the conversion of
> all the data, will the return code of iconv() be the cumulative count of
> "irreversable conversions"? or only that of my last call to iconv()?
> 
> On Fri, 2006-03-03 at 12:13 +0800, simon.zheng wrote:
> > Hi,
> > 
> > Bug 333213 â?? Can't specify the encoding as ISO-8859-15 in mail composer
> > on Solaris.
> > http://bugzilla.gnome.org/show_bug.cgi?id=333213
> > 
> > Attached a patch for review. 
> > 
> > Changing wrapper for iconv(). Translate non-zero value returned by
> > iconv() to -1.
> > 
> > Thanks,
> > -Simon
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches




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