aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-filter-tohtml.c
Commit message (Collapse)AuthorAgeFilesLines
* New test suite for the mime parser (which is where the below 2 fixes wereJeffrey Stedfast2003-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/message/test4.c: New test suite for the mime parser (which is where the below 2 fixes were noticed). * camel-mime-parser.c (folder_boundary_check): Calculate 'len' by subtracting the boundary start from inend rather than 'atleast'. (folder_scan_content): Calculate 'inend' differently depending on the EOF state. 2003-08-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Rather than checking *inptr == '\n', check inptr >= inend - this gets rid of an Invalid Read report from valgrind. * camel-mime-part.c (write_to_stream): Don't necessarily re-encode just because the encodings differ. Need to look into making it so that message/rfc822 and multipart parts ignore the Content-Transfer-Encoding header and just keep their 'encoding' bits set to DEFAULT. 2003-08-05 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Updated. * camel-mime-message.c (camel_mime_message_init): Don't override the mime_type here. (process_header): Updated to use CamelDataWrapper's mime_type field. (find_best_encoding): Same. (best_encoding): Here too. * camel-digest-folder.c (camel_digest_folder_new): Updated for CamelMimePart::content_type change. * camel-mime-part.c (camel_mime_part_init): Override our parent class's default mime_type. (camel_mime_part_finalize): Don't need to unref the content_type anymore. (process_header): Updated to use CamelDataWrapper's mime_type field. (camel_mime_part_set_filename): Same. (camel_mime_part_get_filename): Same. (camel_mime_part_get_content_type): Same. (set_content_object): Here too. (write_to_stream): Updated. (construct_from_parser): Updated. * camel-mime-part.h: Remove the content_type field. 2003-07-31 Jeffrey Stedfast <fejj@ximian.com> * tests/lib/messages.c (test_message_compare_content): If the chunks differ, perform a hexdump on the data being compared so that we may analyse it easier. * camel-multipart-signed.c (write_to_stream): Return ssize_t. * camel-mime-utils.h: Added the CamelMimePartEncodingType enum here. * camel-mime-part.h: Removed the CamelMimePartEncodingType enum from here. * camel-mime-part.c (write_to_stream): Updated to return ssize_t. Also minor changes to only re-encode the content stream if the charset or encoding changed (this way we write it out in the original raw form if nothing changed). * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Drastically simplify. We no longer scan html content to try and find the charset, nor do we care about converting the content to UTF-8 and handling broken windows charsets. * camel-mime-message.c (find_best_encoding): Use decode_to_stream() here. Also updated to not assume the content charset is UTF-8 since it is very likely not the case anymore since data-wrappers no longer are converted to UTF-8 at parse time. * camel-folder-summary.c (summary_build_content_info_message): Use decode_to_stream instead here too. * camel-folder-search.c (match_words_1message): Use decode_to_stream instead of write_to_stream so we can search the contents. * camel-data-wrapper.c (camel_data_wrapper_init): Set the default encoding to DEFAULT. (write_to_stream): Updated to return ssize_t (camel_data_wrapper_decode_to_stream): New virtual function to decode a data wrapper to a stream (results in nearly identical behaviour to the old write_to_stream method). (decode_to_stream): Default implementation of above virtual method. Decodes base64/qp/etc streams. * camel-data-wrapper.h: Removed the rawtext bit and added an encoding member. svn path=/trunk/; revision=22171
* Fix for #46168 'some additional locale aliases required for chineseSuresh Chandrasekharan2003-07-291-0/+8
| | | | | | | | | | | | | | | | | | | | 2003-07-11 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> * camel-iconv.c: Fix for #46168 'some additional locale aliases required for chinese support'. 2003-07-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c (header_decode_word): Revert NotZed's fix for bug #42170 - this causes even more problems than it solves. See bug #46331 for info. Basically, each address header would be converted to UTF-8 twice which means no raw 8bit address header would render correctly. (header_decode_mailbox): Perform a sanity check on the resultant addr->str to make sure that it is valid UTF-8, if not convert it to UTF-8. Fixes bug #42170. svn path=/trunk/; revision=22013
* Urls are unlikely to end with punctuation or closing braces, so strip anyJeffrey Stedfast2003-04-181-4/+7
| | | | | | | | | | | | | | | | | | | 2003-04-16 Jeffrey Stedfast <fejj@ximian.com> * camel-url-scanner.c (camel_url_web_end): Urls are unlikely to end with punctuation or closing braces, so strip any of those off the end of the url. Fixes bug #41461. * tests/mime-filter/data/html.1.out: Removed a trailing \n at the end of the file, this is incorrect (since out input file does not contain one). * camel-mime-filter-tohtml.c (html_convert): Only output a <br> if we found an eoln in the input. Along the same lines, don't write a '\n' to the output buffer unless we've encountered that eoln in the input. Fixes bug #41407. svn path=/trunk/; revision=20882
* filter data test cases.Not Zed2003-04-101-14/+18
| | | | | | | | | | | | | | | 2003-04-10 Not Zed <NotZed@Ximian.com> * tests/mime-filter/data: filter data test cases. * tests/mime-filter/test-tohtml.c: New test for html filter. ** See bug #40969 * camel-mime-filter-tohtml.c (html_convert): Change the logic slightly, scan a whole line within the main loop. svn path=/trunk/; revision=20799
* Same as the ones below.Jeffrey Stedfast2003-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c: Same as the ones below. * camel-mime-part.c: Reverted back to pre-camel-iconv * camel-filter-search.c: Same as below. * camel-folder-summary.c: Reverted back to pre-camel-iconv * camel.c (camel_init): Reverted to pre-camel-iconv * camel-charset-map.c (camel_charset_locale_name): Removed (part of the revert). (camel_charset_canonical_name): Same. * camel-mime-filter-charset.c: Revert back to using e_iconv from GAL. * camel-mime-part-utils.c: Revert back to using e_iconv from GAL. * camel-mime-utils.c: Revert back to using e_iconv from GAL. * camel-sasl-digest-md5.c: Revert back to using e-iconv from GAL. svn path=/trunk/; revision=20056
* fix header include order.Not Zed2003-01-131-1/+1
| | | | | | | | | | | | | | 2003-01-13 Not Zed <NotZed@Ximian.com> * camel-mime-filter-tohtml.c: fix header include order. * camel-object.c (camel_object_bag_reserve): Add an assert to check we're not trying to reserve the bag more than once in a given thread. (camel_object_bag_list): If we have reserved the bag, dont try and cond wait. Fixes a deadlock. svn path=/trunk/; revision=19424
* Read the characters as utf8, rather than as 8 bit bytes. Remove theNot Zed2003-01-131-17/+21
| | | | | | | | | | | | | | 2003-01-13 Not Zed <NotZed@Ximian.com> * camel-mime-filter-tohtml.c (writeln): Read the characters as utf8, rather than as 8 bit bytes. Remove the PRESERVE_8BIT as it has no meaning. Also change the default logic slightly so that 8 bit or greater characters are properly converted to entities. * camel-utf8.c (camel_utf8_getc_limit): new function, gets a utf8 char, bounded by an end pointer. svn path=/trunk/; revision=19421
* New convenience function to replace calls to e_text_to_html() in theJeffrey Stedfast2002-12-171-0/+22
| | | | | | | | | | 2002-12-16 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (camel_text_to_html): New convenience function to replace calls to e_text_to_html() in the mailer/composer etc. svn path=/trunk/; revision=19128
* #include some headers we had forgotten to add previously, also addedJeffrey Stedfast2002-12-161-1/+1
| | | | | | | | | | | | 2002-12-16 Jeffrey Stedfast <fejj@ximian.com> * camel.h: #include some headers we had forgotten to add previously, also added camel-mime-filter-enriched.h. * camel-mime-filter-enriched.[c,h]: New stream filter to convert text/enriched and text/richtext into HTML. svn path=/trunk/; revision=19124
* Use camel-url-scanner instead of regex.Jeffrey Stedfast2002-12-111-89/+37
| | | | | | | | | 2002-12-10 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Use camel-url-scanner instead of regex. svn path=/trunk/; revision=19087
* applied plain_signature_fix.patchRadek Doulik2002-11-201-1/+1
| | | | svn path=/trunk/; revision=18841
* Rewritten. Much much much cleaner implementation now, though usesJeffrey Stedfast2002-11-111-328/+253
| | | | | | | | | | 2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Rewritten. Much much much cleaner implementation now, though uses malloc/free more often than I'd like. svn path=/trunk/; revision=18691
* Match file: urls too.Jeffrey Stedfast2002-08-291-1/+2
| | | | | | | | 2002-08-28 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (is_protocol): Match file: urls too. svn path=/trunk/; revision=17900
* Don't use "isprint(c)" to mean "c >= 32 && c < 128" since it doesn't inJeffrey Stedfast2002-08-011-25/+37
| | | | | | | | | | | | | | | 2002-07-31 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (is_addr_char): Don't use "isprint(c)" to mean "c >= 32 && c < 128" since it doesn't in most locales. (is_url_char): Same. (is_trailing_garbage): Same. (is_domain_name_char): New macro for dns-valid characters (email_address_extract): Use is_domain_name_char rather than is_addr_char for the part after the @. svn path=/trunk/; revision=17660
* New mime filter to convert plain text to html.Jeffrey Stedfast2001-11-171-0/+520
2001-11-16 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (camel_mime_filter_tohtml_new): New mime filter to convert plain text to html. svn path=/trunk/; revision=14737