diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2003-10-02 20:55:58 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2003-10-02 20:55:58 +0000 |
commit | 1cf501d6f87b43d3b20cdc1df1942dccff3796bd (patch) | |
tree | 888348323662d1fceb365259a7bc1b95e8e8d3f1 /net-im/centericq/files | |
parent | . s:NO_CDROM:RESTRICTED: as neither the distfiles nor the packages should (diff) |
This commit was manufactured by cvs2svn to create tag 'RELEASE_4_9_0'.release/4.9.0
Notes
Notes:
svn path=/head/; revision=90063
svn path=/tags/RELEASE_4_9_0/; revision=90064; tag=release/4.9.0
Diffstat (limited to 'net-im/centericq/files')
-rw-r--r-- | net-im/centericq/files/patch-Xml.h | 11 | ||||
-rw-r--r-- | net-im/centericq/files/patch-msnhook.cc | 182 | ||||
-rw-r--r-- | net-im/centericq/files/patch-src:Makefile.in | 7 | ||||
-rw-r--r-- | net-im/centericq/files/patch-utf8conv.h | 61 |
4 files changed, 0 insertions, 261 deletions
diff --git a/net-im/centericq/files/patch-Xml.h b/net-im/centericq/files/patch-Xml.h deleted file mode 100644 index 9a9aa8e52a9d..000000000000 --- a/net-im/centericq/files/patch-Xml.h +++ /dev/null @@ -1,11 +0,0 @@ ---- libicq2000-0.1/libicq2000/Xml.h.orig Sun Jul 27 14:08:10 2003 -+++ libicq2000-0.1/libicq2000/Xml.h Sun Jul 27 14:08:26 2003 -@@ -24,6 +24,8 @@ - #ifndef XML_H - #define XML_H - -+using namespace std; -+ - #include <string> - #include <list> - #include <ctype.h> diff --git a/net-im/centericq/files/patch-msnhook.cc b/net-im/centericq/files/patch-msnhook.cc deleted file mode 100644 index 6ec55a2bacd4..000000000000 --- a/net-im/centericq/files/patch-msnhook.cc +++ /dev/null @@ -1,182 +0,0 @@ ---- src/hooks/msnhook.cc.orig Thu May 8 14:42:56 2003 -+++ src/hooks/msnhook.cc Thu May 8 14:47:52 2003 -@@ -30,6 +30,7 @@ - #include "eventmanager.h" - #include "imlogger.h" - #include "connwrap.h" -+#include "utf8conv.h" - - #include "msn_bittybits.h" - -@@ -259,7 +260,8 @@ - } - - icqcontact *c = clist.get(ev.getcontact()); -- text = siconv(text, conf.getrussian(msn) ? "koi8-u" : DEFAULT_CHARSET, "utf8"); -+// text = siconv(text, conf.getrussian(msn) ? "koi8-u" : DEFAULT_CHARSET, "utf8"); -+ text = StrToUtf8(text); - - if(c) - if(c->getstatus() != offline || !c->inlist()) { -@@ -389,11 +391,11 @@ - - void msnhook::checkfriendly(icqcontact *c, const string friendlynick, bool forcefetch) { - string oldnick = c->getnick(); -- string newnick = unmime(friendlynick); -+ string newnick = Utf8ToStr(unmime(friendlynick)); - - c->setnick(newnick); - -- if(forcefetch || (oldnick != newnick && c->getdispnick() == oldnick) || oldnick.empty()) { -+ if(forcefetch || (oldnick != newnick && c->getdispnick() != newnick) || oldnick.empty()) { - c->setdispnick(newnick); - face.relaxedupdate(); - } -@@ -613,7 +615,8 @@ - - mhook.checkinlist(ic); - -- string text = siconv(msg->body, "utf8", conf.getrussian(msn) ? "koi8-u" : DEFAULT_CHARSET); -+// string text = siconv(msg->body, "utf8", conf.getrussian(msn) ? "koi8-u" : DEFAULT_CHARSET); -+ string text = Utf8ToStr(msg->body); - em.store(immessage(ic, imevent::incoming, text)); - } - -@@ -795,3 +798,137 @@ - log(string("[OUT] ") + buf); - } - } -+ -+#if HAVE_ICONV_H -+int safe_iconv( iconv_t handle, const char **inbuf, size_t *inbytesleft, -+ char **outbuf, size_t *outbytesleft) -+{ -+ int ret; -+ while (*inbytesleft) { -+ ret = iconv( handle, inbuf, inbytesleft, -+ outbuf, outbytesleft); -+ if (!*inbytesleft || !*outbytesleft) -+ return ret; -+ /*got invalid seq - so replace it with '?' */ -+ **outbuf = '?'; (*outbuf)++; (*outbytesleft)--; -+ (*inbuf)++; (*inbytesleft)--; -+ } -+ return ret; -+} -+ -+const char* guess_current_locale_charset() -+{ -+ char *lang, *ch; -+ /* Return previously learned charset */ -+ if (loc_charset[0]) -+ return loc_charset; -+ -+ lang = getenv("LANG"); -+ if (!lang) { -+ strcpy( loc_charset, DEFAULT_CHARSET ); -+ return loc_charset; -+ }; -+ ch = strrchr( lang, '.' ); -+ if (!ch) -+ strcpy( loc_charset, DEFAULT_CHARSET ); -+ else { -+ iconv_t pt; -+ ch++; -+ strncpy( loc_charset, ch, sizeof(loc_charset) ); -+ /* try to open iconv handle using guessed charset */ -+ if ( (pt = iconv_open( loc_charset, loc_charset )) == (iconv_t)(-1) ) -+ { -+ strcpy( loc_charset, DEFAULT_CHARSET ); -+ } else { -+ iconv_close(pt); -+ }; -+ -+ } -+ -+ return loc_charset; -+} -+ -+char *StrToUtf8( const char *inbuf ) -+{ -+ size_t length = strlen( inbuf ); -+ size_t outmaxlength = UTF8_BUF_LENGTH; -+ char *outbuf = utf8_buf; -+ char *outbuf_save = outbuf; -+ int ret; -+ -+ iconv_t handle = iconv_open( "utf-8", guess_current_locale_charset() ); -+ if(((int) handle) != -1) { -+ ret = safe_iconv( handle, (const char **) &inbuf, &length, &outbuf, &outmaxlength ); -+ -+ *outbuf = '\0'; -+ iconv_close( handle ); -+ return outbuf_save; -+ } else { -+ return (char *)inbuf; -+ }; -+} -+ -+std::string StrToUtf8( const std::string &instr ) -+{ -+ size_t length = instr.length(); -+ size_t outmaxlength = UTF8_BUF_LENGTH; -+ const char *inbuf = instr.c_str(); -+ char *outbuf = utf8_buf; -+ char *outbuf_save = outbuf; -+ int ret; -+ -+ iconv_t handle = iconv_open( "utf-8", guess_current_locale_charset() ); -+ if(((int) handle) != -1) { -+ ret = safe_iconv( handle, (const char **) &inbuf, &length, &outbuf, &outmaxlength ); -+ -+ *outbuf = '\0'; -+ iconv_close( handle ); -+ -+ std::string return_me = outbuf_save; -+ return return_me; -+ } else { -+ return instr; -+ }; -+} -+ -+char *Utf8ToStr( const char *inbuf ) -+{ -+ size_t length = strlen( inbuf ); -+ size_t outmaxlength = UTF8_BUF_LENGTH / 4; -+ char *outbuf = utf8_buf; -+ char *outbuf_save = outbuf; -+ int ret; -+ -+ iconv_t handle = iconv_open( guess_current_locale_charset(), "utf-8" ); -+ if(((int) handle) != -1) { -+ ret = safe_iconv( handle, (const char **) &inbuf, &length, &outbuf, &outmaxlength ); -+ *outbuf = '\0'; -+ iconv_close( handle ); -+ return outbuf_save; -+ } else { -+ return (char *)inbuf; -+ }; -+} -+ -+std::string Utf8ToStr( const std::string &instr ) -+{ -+ size_t length = instr.length(); -+ const char *inbuf = instr.c_str(); -+ size_t outmaxlength = UTF8_BUF_LENGTH / 4; -+ char *outbuf = utf8_buf; -+ char *outbuf_save = outbuf; -+ int ret; -+ -+ iconv_t handle = iconv_open( guess_current_locale_charset(), "utf-8" ); -+ -+ if(((int) handle) != -1) { -+ ret = safe_iconv( handle, (const char **) &inbuf, &length, &outbuf, &outmaxlength ); -+ *outbuf = '\0'; -+ iconv_close( handle ); -+ std::string return_me = outbuf_save; -+ return return_me; -+ } else { -+ return instr; -+ }; -+} -+#endif /* HAVE_ICONV_H */ diff --git a/net-im/centericq/files/patch-src:Makefile.in b/net-im/centericq/files/patch-src:Makefile.in deleted file mode 100644 index 413071b5991d..000000000000 --- a/net-im/centericq/files/patch-src:Makefile.in +++ /dev/null @@ -1,7 +0,0 @@ ---- src/Makefile.in.orig Thu May 8 14:58:44 2003 -+++ src/Makefile.in Thu May 8 14:58:57 2003 -@@ -98,3 +98,3 @@ - centericq_LDFLAGS = -L$(top_srcdir)/blip-0.1 -L$(top_srcdir)/firetalk-0.1 -L$(top_srcdir)/kkconsui-0.1 -L$(top_srcdir)/kkstrtext-0.1 -L$(top_srcdir)/libicq2000-0.1 -L$(top_srcdir)/libjabber-0.1 -L$(top_srcdir)/libyahoo2-0.1 -L$(top_srcdir)/kksystr-0.1 -L$(top_srcdir)/connwrap-0.1 --centericq_LDADD = $(top_srcdir)/src/hooks/libhooks.a -lblip -lfiretalk -lkkconsui -lkkstrtext -llibicq2000 -llibjabber -llibyahoo2 -lkksystr -lconnwrap @INTLLIBS@ -+centericq_LDADD = $(top_srcdir)/src/hooks/libhooks.a -lblip -lfiretalk -lkkconsui -lkkstrtext -llibicq2000 -llibjabber -llibyahoo2 -lkksystr -lconnwrap @INTLLIBS@ -lintl - SUBDIRS = hooks diff --git a/net-im/centericq/files/patch-utf8conv.h b/net-im/centericq/files/patch-utf8conv.h deleted file mode 100644 index 838fe7c819be..000000000000 --- a/net-im/centericq/files/patch-utf8conv.h +++ /dev/null @@ -1,61 +0,0 @@ ---- src/hooks/utf8conv.h Thu Jan 1 08:00:00 1970 -+++ src/hooks/utf8conv.h Tue Nov 26 16:10:40 2002 -@@ -0,0 +1,58 @@ -+/*-------------------------------------------------------*/ -+/* utf8conv.h ( Utf8 Converter ) */ -+/*-------------------------------------------------------*/ -+/* target : Converting Utf8 from/to string/char */ -+/* modifier : clsung@dragon2.net */ -+/* create : unknown */ -+/* update : 02/11/26 */ -+/*-------------------------------------------------------*/ -+#ifndef _UTF8CONV_ -+#define _UTF8CONV_ -+ -+#ifndef HAVE_ICONV_H -+#define HAVE_ICONV_H -+#endif -+ -+#ifdef HAVE_ICONV_H -+#include <iconv.h> -+#endif -+#include <string> -+#define DEFAULT_CHARSET "ISO-8859-1" -+#define UTF8_BUF_LENGTH 2048 -+/* charset name cache buffer */ -+static char loc_charset[32]; -+static char utf8_buf[UTF8_BUF_LENGTH]; // max 401 length or per message -+/* -+** Name: safe_iconv -+** Purpose: 'Fault-tolerant' version if iconv. Replaces invalid seq with '?' -+** Input: see iconv manpage -+*/ -+int safe_iconv( iconv_t handle, const char **inbuf, size_t *inbytesleft, -+ char **outbuf, size_t *outbytesleft); -+ -+/* -+** Name: guess_current_locale_charset -+** Purpose: Try to guess default charset for the current locale -+** Output: charset name -+** FIXME: is there more right method for guessing charset -+ than scanning $LANG ? -+*/ -+const char* guess_current_locale_charset(); -+ -+/* -+** Name: Str2Utf8 -+** Purpose: convert a string in UTF-8 format -+** Input: inbuf - the string to convert -+** Output: a new string in UTF-8 format -+*/ -+char *StrToUtf8( const char *inbuf ); -+std::string StrToUtf8( const std::string &instr ); -+/* -+** Name: Utf8ToStr -+** Purpose: revert UTF-8 string conversion -+** Input: inbuf - the string to decode -+** Output: a new decoded string -+*/ -+char *Utf8ToStr( const char *inbuf ); -+std::string Utf8ToStr( const std::string &instr ); -+#endif |