Re: [gmime-devel] \n when exporting the message



Hi Kane,

 

GMime uses \n instead of \r\n because on Unix (which is what GMime was designed for) uses \n as a newline instead of \r\n.

 

While, yes, internet protocols use \r\n, that is not how messages are written to disk on Unix machines in Maildir or mbox files.

 

Starting with GMime 3.0, there is now a GMimeFormatOptions which you can use to specify the newline format that GMime should use when writing out messages (and anything else that takes a GMimeFormatOptions parameter).

 

This is better than using a CRLF filter (which was split into Unix2Dos and Dos2Unix filters) because binary data would get altered by filters, but not by the format options mechanism.

 

Hope that helps,

 

Jeff

 

From: gmime-devel-list <gmime-devel-list-bounces gnome org> on behalf of Kane Kim <kane isturm gmail com>
Date: Monday, August 14, 2017 at 1:10 PM
To: "gmime-devel-list gnome org" <gmime-devel-list gnome org>
Subject: [gmime-devel] n when exporting the message

 

Hello,

 

Why does gmime use \n when writing to stream instead of \r\n?

Right now I'm using crlf filter to convert it, is there an option to change it globally?

 

Thanks.



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