4 * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API
6 * Copyright (C) 2000-2016 by Olaf `Olsen' Barthel <obarthel -at- gmx -dot- net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _UTF_8_ISO_8859_1_CONVERSION_H
24 #define _UTF_8_ISO_8859_1_CONVERSION_H
26 /****************************************************************************/
28 /* Encode a string of characters in ISO 8859 Latin-1 encoding into
29 * UTF-8 representation (rfc2279). Will encode as many characters as
30 * will fit into the output buffer, and NUL-terminates the result.
31 * Returns the number of UTF-8 characters in the output buffer.
33 extern int encode_iso8859_1_as_utf8_string(const unsigned char * const from
,int from_len
,unsigned char * to
,int to_size
);
35 /****************************************************************************/
37 /* Decode a string of characters encoded in UTF-8 representation (rfc2279).
38 * Will decode and retain only characters that can be decoded properly
39 * and which fit into the ASCII/BMP Latin-1 supplementary range. Will
40 * decode as many characters as will fit into the output buffer, and
41 * NUL-terminates the result. Returns the number of characters in the
42 * output buffer, or -1 for decoding error.
44 * Note that decoding will stop once a NUL has been found in the
45 * input string to be decoded.
47 extern int decode_utf8_as_iso8859_1_string(const unsigned char * const from
,int from_len
,unsigned char * to
,int to_size
);
49 /****************************************************************************/
51 #endif /* _UTF_8_ISO_8859_1_CONVERSION_H */