Le 28 octobre ? 22:20, James Edward Gray II a ?crit :

> The outstanding issue is how to handle character sets for the  
> constructed message.  You'll see in the code below that I just pull  
> the charset param from the original message, but after looking at a  
> few messages, I realize that this doesn't make sense.  For example,  
> here are the relevant portions of a recent post that wasn't gated  
> correctly:
> 
>    Content-Type: multipart/alternative; boundary=Apple-Mail-18-445454026
> 
>    --Apple-Mail-18-445454026
>    Content-Transfer-Encoding: 7bit
>    Content-Type: text/plain;
>    	charset=US-ASCII;
>    	delsp=yes;
>    	format=flowed
> 
> As you can see, the overall email doesn't have a charset but each  
> text portion can.  If we are going to merge these parts, what's the  
> best strategy for handling the charset?

Well, usually, you don't have more than one charset in a message ; you
should push the charset of the part back to the main header and be done
with it.

Now, if you have more than one text part and different charsets, it's a
bit more complicated...
 
> I thought of trying to convert them all to UTF-8 with Iconv, but I'm  
> not sure what to do if a type doesn't declare a charset or when Iconv  
> chokes on what is declared?  Please share your opinions.

Hm...  Complain to the poster / the software writer ?  :)

Fred
-- 
Good thing I calmed down after all this mindless destruction.  I mean,
destroy the world single handedly, what the hell was I thinking.  I'd
need a tank to do that...  Mmmm...  Tank...
                 (Fusion D, Yamcha Hibiki, http://fusiond.keenspace.com)