File: utils.c

package info (click to toggle)
wmcliphist 2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 308 kB
  • sloc: ansic: 1,869; makefile: 47
file content (24 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "wmcliphist.h"

/*
 * converts text in UTF-8 to charset by actual locale
 */
gchar *
from_utf8(gchar *string) {
	gsize	bytes_read;
	gsize	bytes_written;
	GError	*error;
	gchar	*converted;
	/* gchar	*error_msg; */
	/* gint	error_code; */

	converted = g_locale_from_utf8(string, -1, &bytes_read, &bytes_written,
			&error);
	/* error_code = (error == NULL) ? 0 : error->code; */
        /*
	 * fprintf(stderr, "from_utf8: %d b read, %d b written, error: %d\n",
	 * 		bytes_read, bytes_written, error_code);
         */

	return converted;
}