annotate libpurple/protocols/oscar/encoding.h @ 32805:064eb5d78946

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 0ba3afb8adb303a77581a7872d674c600979a5a6) to branch 'im.pidgin.pidgin' (head 7711a4d267e1fe776387496c764fb63227d70aec)
author Mark Doliner <mark@kingant.net>
date Mon, 31 Oct 2011 01:25:36 +0000
parents ed520e6e972b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30817
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
1 /*
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
2 * Purple's oscar protocol plugin
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
3 * This file is the legal property of its developers.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
4 * Please see the AUTHORS file distributed alongside this file.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
5 *
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
6 * This library is free software; you can redistribute it and/or
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
9 * version 2 of the License, or (at your option) any later version.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
10 *
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
11 * This library is distributed in the hope that it will be useful,
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
14 * Lesser General Public License for more details.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
15 *
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
17 * License along with this library; if not, write to the Free Software
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
19 */
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
20
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
21 #ifndef _ENCODING_H_
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
22 #define _ENCODING_H_
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
23
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
24 #include "oscar.h"
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
25 #include "oscarcommon.h"
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
26
30819
ca90b6c27eb8 Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents: 30818
diff changeset
27 gchar * oscar_encoding_to_utf8(const char *encoding, const char *text, int textlen);
30817
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
28 gchar * oscar_utf8_try_convert(PurpleAccount *account, OscarData *od, const gchar *msg);
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
29
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
30 /**
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
31 * This attemps to decode an incoming IM into a UTF8 string.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
32 *
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
33 * We try decoding using two different character sets. The charset
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
34 * specified in the IM determines the order in which we attempt to
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
35 * decode. We do this because there are lots of broken ICQ clients
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
36 * that don't correctly send non-ASCII messages. And if Purple isn't
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
37 * able to deal with that crap, then people complain like banshees.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
38 */
30824
5661f30d1b8e Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents: 30819
diff changeset
39 gchar * oscar_decode_im(PurpleAccount *account, const char *sourcebn, guint16 charset, const gchar *data, gsize datalen);
30817
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
40
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
41 /**
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
42 * Figure out what encoding to use when sending a given outgoing message.
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
43 */
30827
ed520e6e972b Renames and cleanups.
ivan.komarov@soc.pidgin.im
parents: 30824
diff changeset
44 gchar * oscar_encode_im(const gchar *msg, gsize *result_len, guint16 *charset, gchar **charsetstr);
30817
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
45
42862490dcb7 Damn it.
ivan.komarov@soc.pidgin.im
parents:
diff changeset
46 #endif