File: test-encoding.c

package info (click to toggle)
tepl 6.4.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,692 kB
  • sloc: ansic: 16,879; xml: 542; sh: 20; makefile: 9
file content (32 lines) | stat: -rw-r--r-- 751 bytes parent folder | download
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
/* SPDX-FileCopyrightText: 2022 - Sébastien Wilmet <swilmet@gnome.org>
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#include <tepl/tepl.h>
#include <stdlib.h>

int
main (int    argc,
      char **argv)
{
	GSList *list;
	GSList *l;

	tepl_init ();
	gtk_init (&argc, &argv);

	list = tepl_encoding_iconv_get_all ();
	for (l = list; l != NULL; l = l->next)
	{
		const TeplEncodingIconv *encoding_iconv = l->data;
		const TeplEncoding *encoding = tepl_encoding_iconv_to_base_type (encoding_iconv);

		g_print ("Category: '%s' ; Name: '%s'\n",
			 tepl_encoding_get_category_name (encoding),
			 tepl_encoding_get_name (encoding));
	}
	g_slist_free_full (list, (GDestroyNotify) tepl_encoding_iconv_free);

	tepl_finalize ();
	return EXIT_SUCCESS;
}