-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
I found a problem with unicode encoding. When I klicked "retrieve" in my
user info I got an error like:
Error encoding () to UCS-2BE from (unsupported conversion)
This happens when the user has a german umlaut in his alias.
The main problem is a wrong value of nInSize. The value is not the
length of the input buffer but it needs to.
A second problem can occur if converting to UTF8 fails and licq tries to
convert to UCS-2BE. Here all used values for iconv() are changed if some
characters could be converted but not all. So we need to set the values
again.
A patch is attached.
regards,
rsLeo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEYb8suFcJvHsEu9gRArnEAJ9KkMS/hm6JtMI3CR9gAO6p1slsSACcC/wP
348iCANXefAt5Hjn9j2lf1Q=
=dtAO
-----END PGP SIGNATURE-----
--- licq/src/translate.cpp 2006-04-01 18:42:18.000000000 +0200
+++ licq_tmp/src/translate.cpp 2006-05-10 11:51:42.356906536 +0200
@@ -226,7 +226,7 @@
char *szIn = _sz, *szOut = szNewStr;
iconv_t tr;
- nInSize = nLen;
+ nInSize = strlen(_sz);
nOutSize = nLen;
// Clean up for iconv, remove any spaces
@@ -249,6 +249,12 @@
if (ret == (size_t)(-1))
{
+ //set new values because iconv() is changing them
+ szIn = _sz;
+ szOut = szNewStr;
+ nInSize = strlen(_sz);
+ nOutSize = nLen;
+
tr = iconv_open("UCS-2BE", szFrom[0] == '\0' ? "" : szFrom);
if (tr == (iconv_t)-1)
{