<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Yuval,<br>
<br>
Answers below...<br>
<br>
<br>
On 7/18/2017 5:12 PM, Yuval Peduel via gmime-devel-list wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1564071740.3452057.1500412375971@mail.yahoo.com">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:13px">
<div id="yui_3_16_0_ym19_1_1500397773251_17949"><span
id="yui_3_16_0_ym19_1_1500397773251_17989"><font
id="yui_3_16_0_ym19_1_1500397773251_24230" size="2">Thank
you for the prompt response.</font></span></div>
<div id="yui_3_16_0_ym19_1_1500397773251_17949"><span><font
size="2"><br>
</font></span></div>
<div id="yui_3_16_0_ym19_1_1500397773251_17949"><span
id="yui_3_16_0_ym19_1_1500397773251_18519"><font size="2">My
apologies. I thought I had included that snippet of code.
To print the encoding I use:</font></span></div>
<div id="yui_3_16_0_ym19_1_1500397773251_17949"><span><font
size="2"><br>
</font></span></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18066"><font
id="yui_3_16_0_ym19_1_1500397773251_24241" size="2"><b
id="yui_3_16_0_ym19_1_1500397773251_24251">Â Â
GMimeContentEncoding encoding =</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18067"><font
id="yui_3_16_0_ym19_1_1500397773251_24239" size="2"><b>Â Â Â
 g_mime_part_get_content_encoding(part);</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18068"><font
id="yui_3_16_0_ym19_1_1500397773251_24237" size="2"><b>Â Â
const char* encoding_as_string =</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18069"><font
id="yui_3_16_0_ym19_1_1500397773251_24235" size="2"><b>Â Â Â
 g_mime_content_encoding_to_string(encoding);</b></font></div>
</div>
</blockquote>
<br>
If the encoding is GMIME_CONTENT_ENCODING_DEFAULT, then the return
value will be NULL.<br>
<br>
Since none of your MIME parts in your sample message had a
Content-Transfer-Encoding header, no encoding was specified (which
generally means you should treat it as "8bit").<br>
<br>
<blockquote type="cite"
cite="mid:1564071740.3452057.1500412375971@mail.yahoo.com">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:13px">
<div id="yui_3_16_0_ym19_1_1500397773251_18070"><font size="2"><b><br
id="yui_3_16_0_ym19_1_1500397773251_18071">
</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18072"><font
id="yui_3_16_0_ym19_1_1500397773251_24233" size="2"><b>Â Â
cout << indent << "- content encoding: ";</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18073"><font
id="yui_3_16_0_ym19_1_1500397773251_24227" size="2"><b>Â Â
if (encoding_as_string)</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18074"><font size="2"><b>Â
   cout << encoding_as_string;</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18075"><font size="2"><b>Â
 else</b></font></div>
<div id="yui_3_16_0_ym19_1_1500397773251_18076"><font size="2"><b>Â
   cout << "NULL";</b></font></div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1500397773251_18077"><font
size="2"><b>Â Â cout << endl; Â Â Â Â Â Â Â </b></font></div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1500397773251_18077"><font
size="2"><br>
</font></div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1500397773251_18077"><font
id="yui_3_16_0_ym19_1_1500397773251_24243" size="2">As for
the content_description, I was expecting "<span
style="font-family: "Helvetica Neue",
"Segoe UI", Helvetica, Arial, "Lucida
Grande", sans-serif;"
id="yui_3_16_0_ym19_1_1500397773251_18350">text/plain" and
"text/html". If this is the wrong field to get this
discrimination, which field would be correct?</span></font></div>
</div>
</blockquote>
<br>
No. The g_mime_part_get_content_description() functions returns the
value provided for the Content-Description header (which none of
your MIME parts contained).<br>
<br>
If you want the value of the Content-Type header, you need to use
g_mime_object_get_content_type() :)<br>
<br>
However, that won't return a string, it will return a
GMimeContentType due to the fact that you typically want to access
parameter values.<br>
<br>
<blockquote type="cite"
cite="mid:1564071740.3452057.1500412375971@mail.yahoo.com">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:13px">
<div dir="ltr" id="yui_3_16_0_ym19_1_1500397773251_18077"><span
style="font-family: "Helvetica Neue", "Segoe
UI", Helvetica, Arial, "Lucida Grande",
sans-serif;"><font size="2"><br>
</font></span></div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1500397773251_18077"><font
id="yui_3_16_0_ym19_1_1500397773251_24231" size="2"><span
style="font-family: "Helvetica Neue",
"Segoe UI", Helvetica, Arial, "Lucida
Grande", sans-serif;"
id="yui_3_16_0_ym19_1_1500397773251_24244">Related to that
(but lower priority), how do I get the "</span><span
style="font-family: "Helvetica Neue",
"Segoe UI", Helvetica, Arial, "Lucida
Grande", sans-serif;"
id="yui_3_16_0_ym19_1_1500397773251_18746">multipart/alternative;"
field from the multipart? the content type from the top
level part returned by </span><span style="color: rgb(0,
0, 1); font-family: Verdana;"
id="yui_3_16_0_ym19_1_1500397773251_24103">g_mime_message_get_mime_part(message)?</span></font></div>
</div>
</blockquote>
<br>
Yes.<br>
<br>
<br>
Hope that helps,<br>
<br>
Jeff<br>
<br>
</body>
</html>