Files
evolution/tests/test6.c
Robert Brady 85067acb32 encoder test.
1999-08-06  Robert Brady  <rwb197@ecs.soton.ac.uk>

	* tests/test6.c: encoder test.

	* camel/gmime-rfc2047.c: Fixed decoder bug : sequence
	?= is not always the terminator for an encoded-string.

svn path=/trunk/; revision=1091
1999-08-06 15:47:45 +00:00

51 lines
1022 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* test for the RFC 2047 encoder */
#include <string.h>
#include <unicode.h>
#include "gmime-utils.h"
#include "stdio.h"
#include "camel-log.h"
#include "camel-mime-message.h"
#include "camel-mime-part.h"
#include "camel-stream.h"
#include "camel-stream-fs.h"
#include "camel.h"
#include "gmime-rfc2047.h"
#define TERMINAL_CHARSET "UTF-8"
/*
* Info on many unicode issues, including, utf-8 xterms from :
*
* http://www.cl.cam.ac.uk/~mgk25/unicode.html
*
*/
const char *tests[] =
{
"Ðis is a test", "ISO-8859-1",
"Iñtérñàtiönælîçation", "ISO-8859-1",
"ΚαλημέÏ<EFBFBD>α κόσμε", "UTF-8",
"ã³ãƒ³ãƒãƒ<EFBFBD>ãƒ<EFBFBD>", "UTF-8",
"ði ıntəˈnæʃənəl fəˈtık əsoʊsiˈeıʃn", "UTF-8",
NULL
};
int
main (int argc, char**argv)
{
const char **b = tests;
while (*b) {
char *e = gmime_rfc2047_encode(b[0], b[1]);
printf("%s\t%s\n", e, gmime_rfc2047_decode(e, TERMINAL_CHARSET));
b+=2;
}
return 0;
}