blob: 99ad40501ed97fa943538fca63867dcb0eb7fa02 (
plain)
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
51
52
53
54
55
56
57
58
59
60
61
|
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef CHAR_CONV_H
#define CHAR_CONV_H
#include "config.h"
#include "Compiler.h"
#include <stdbool.h>
#ifdef HAVE_ICONV
/**
* Initializes the character set conversion library.
*
* @param enable_input allow conversion from locale to UTF-8
* @param enable_output allow conversion from UTF-8 to locale
*/
void
charset_init(bool enable_input, bool enable_output);
void charset_deinit(void);
gcc_pure
const char *
charset_to_utf8(const char *from);
gcc_pure
const char *
charset_from_utf8(const char *from);
#else
static inline void
charset_init(bool disable_input, bool disable_output)
{
(void)disable_input;
(void)disable_output;
}
static inline void
charset_deinit(void)
{
}
static inline const char *
charset_to_utf8(const char *from)
{
return from;
}
static inline const char *
charset_from_utf8(const char *from)
{
return from;
}
#endif
#endif
|