1/* -*- Mode: c; c-basic-offset: 2 -*-
2 *
3 * rdf_utf8.h - RDF UTF8 / Unicode chars helper routines Definition
4 *
5 * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/
6 * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/
7 *
8 * This package is Free Software and part of Redland http://librdf.org/
9 *
10 * It is licensed under the following three licenses as alternatives:
11 * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
12 * 2. GNU General Public License (GPL) V2 or any newer version
13 * 3. Apache License, V2.0 or any newer version
14 *
15 * You may not use this file except in compliance with at least one of
16 * the above three licenses.
17 *
18 * See LICENSE.html or LICENSE.txt at the top of this package for the
19 * complete terms and further detail along with the license texts for
20 * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
21 *
22 *
23 */
24
25
26
27#ifndef LIBRDF_UTF8_H
28#define LIBRDF_UTF8_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <raptor2.h>
35
36/**
37 * librdf_unichar:
38 *
39 * Unicode codepoint.
40 *
41 */
42typedef raptor_unichar librdf_unichar;
43
44REDLAND_API REDLAND_DEPRECATED
45int librdf_unicode_char_to_utf8(librdf_unichar c, unsigned char *output, int length);
46REDLAND_API REDLAND_DEPRECATED
47int librdf_utf8_to_unicode_char(librdf_unichar *output, const unsigned char *input, int length);
48REDLAND_API
49unsigned char* librdf_latin1_to_utf8_2(const unsigned char *input, size_t length, size_t *output_length);
50REDLAND_API
51unsigned char* librdf_utf8_to_latin1_2(const unsigned char *input, size_t length, unsigned char discard, size_t *output_length);
52REDLAND_API REDLAND_DEPRECATED
53unsigned char* librdf_utf8_to_latin1(const unsigned char *input, int length, int *output_length);
54REDLAND_API REDLAND_DEPRECATED
55unsigned char* librdf_latin1_to_utf8(const unsigned char *input, int length, int *output_length);
56REDLAND_API
57void librdf_utf8_print(const unsigned char *input, int length, FILE *stream);
58
59
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif
66