aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test6.c
blob: ead8312c52fbee1004c51cfa86dcb6c9c87b3076 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* -*- 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",
  "Itrtinlation", "ISO-8859-1",
  "Καλημέρα κόσμε", "UTF-8",
  "コンニチハ", "UTF-8",
  "ði ıntəˈnæʃənəl fəˈnɛ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;

}