]> git.lyx.org Git - lyx.git/blob - src/support/unicode.h
f1a75da1891888b6b402f5c8fc6c670597a9062d
[lyx.git] / src / support / unicode.h
1 /**
2  * \file unicode.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  *
10  * A collection of unicode conversion functions, using iconv.
11  */
12
13 #ifndef LYX_SUPPORT_UNICODE_H
14 #define LYX_SUPPORT_UNICODE_H
15
16 #include "support/types.h"
17
18 #include <vector>
19
20
21 namespace lyx {
22
23 // utf8_to_ucs4
24
25 // A single codepoint conversion for utf8_to_ucs4 does not make
26 // sense, so that function is left out.
27
28 std::vector<lyx::char_type> utf8_to_ucs4(std::vector<char> const & utf8str);
29
30 std::vector<lyx::char_type> utf8_to_ucs4(char const * utf8str, size_t ls);
31
32 // ucs2_to_ucs4
33
34 lyx::char_type ucs2_to_ucs4(unsigned short c);
35
36 std::vector<lyx::char_type>
37 ucs2_to_ucs4(std::vector<unsigned short> const & ucs2str);
38
39 std::vector<lyx::char_type>
40 ucs2_to_ucs4(unsigned short const * ucs2str, size_t ls);
41
42 // ucs4_to_ucs2
43
44 unsigned short ucs4_to_ucs2(lyx::char_type c);
45
46 std::vector<unsigned short>
47 ucs4_to_ucs2(std::vector<lyx::char_type> const & ucs4str);
48
49 std::vector<unsigned short> ucs4_to_ucs2(lyx::char_type const * s, size_t ls);
50
51 // ucs4_to_utf8
52
53 std::vector<char> ucs4_to_utf8(lyx::char_type c);
54
55 std::vector<char> ucs4_to_utf8(std::vector<lyx::char_type> const & ucs4str);
56
57 std::vector<char> ucs4_to_utf8(lyx::char_type const * ucs4str, size_t ls);
58
59 extern char const * ucs4_codeset;
60 extern char const * ucs2_codeset;
61
62
63 } // namespace lyx
64
65 #endif