Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67733 - Evolution Palm Conduits - ISO8859-2 problem SOLVED (patch)
Summary: Evolution Palm Conduits - ISO8859-2 problem SOLVED (patch)
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Gentoo PDA project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 17:54 UTC by Michael Dominic K.
Modified: 2008-03-09 13:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Applies to app-pda/pilot-link. In the source: libpisock/util.c (iso8859-2.patch,2.68 KB, patch)
2004-10-15 17:58 UTC, Michael Dominic K.
Details | Diff
app-pda/pilot-link-0.11.8/work/pilot-link-0.11.8/libpisock/util.c (iso8859-2.patch,1.75 KB, patch)
2004-10-16 13:13 UTC, Michael Dominic K.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dominic K. 2004-10-15 17:54:30 UTC
This is a common problem/limitation already described hundred times on different forums etc. A complete description is in a Ximian Evolution Bugzilla:

http://bugzilla.ximian.com/show_bug.cgi?id=14611

It was reported first back 2001, but since then it was NOT FIXED in Evolution. (Even in Evolution 2.0.0). The problem goes as follows: 

0. Evolution stores all the data in UTF-8 character set.
1. Palm Evolution Conduits don't allow to select a character encoding of the data on the Palm. 
2. Conduits rely on the libpisock library (provided by app-pda/pilot-link) to convert/transfer data to the Palm.
3. libpisock assume (hardcoded in the source) that the Palm character set is CP1251. 

The result:

All the people that speak different languages than English can't use Evolution conduits, because their data gets scrambled in the transfer (I'm talking about language specific special characters, ISO8859-2 characters, etc.). 

I made a simple PATCH to libpisock in app-pda/pilot-link, that changes CP1251 to ISO-8859-2 and fixes some iconv bugs (shit code). This patch is universal, and should work with any other application that uses libpisock (although - It looks like Evolution Conduits is a single application, that uses libpisock). This way, I (speaking Polish, and using some polish specific accented characters) can use Evolution Conduits without problems. ISO-8859-2 is the default character set for all the Palm Pilots bundled in Central and Eastern Europe. 

Portage:
I think, this small patch should be a part of the app-pda/pilot-link in the Portage. It should ask user at the compile-time, whetever to apply it or not ("What kind of character set you're using on the Palm?"). The patch is temporary (of course). I hope that one day, the pilot-link devs will move their heads, and allow the character set to be selectable (not harcoded in the source).

I attach the patched/modified file.
It applies to: app-pda/pilot-link
File in the source: libpisock/util.c

Hope you can add that to the portage. It will help a lot of people. 

Reproducible: Always
Steps to Reproduce:
1. Type any name with a ISO-8859-2 character in the Evolution Address Book
2. Sync that to your pilot.
3. Look at the pilot.
Actual Results:  
I got random characters (screwed character set) on the Palm Pilot, instead of
the ISO-8859-2 stuff.

Expected Results:  
Display name excatly same as entered in Evolution Address Book. 

I checked the patch on:

Evolution-2.0.0
pilot-link-0.11.8
gnome-pilot-2.0.12 & 2.0.10
Comment 1 Michael Dominic K. 2004-10-15 17:58:58 UTC
Created attachment 41926 [details, diff]
Applies to app-pda/pilot-link. In the source: libpisock/util.c

Part of the libpisock library compiled with pilot-link.
Comment 2 Michael Dominic K. 2004-10-15 18:00:39 UTC
One small detail - I made a typo. Should be: CP1252 (not CP1251) as the default characterset assumed by libpisock (doesn't change the sense, but just to make it clear). 
Comment 3 foser (RETIRED) gentoo-dev 2004-10-16 02:37:01 UTC
please provide the patch as a 'diff -uNr' to the evolution tree.

Have you posted this patch upstream ? If not, you should. If you did, where is the bugzilla entry ?
Comment 4 Michael Dominic K. 2004-10-16 13:10:23 UTC
Comment on attachment 41926 [details, diff]
Applies to app-pda/pilot-link. In the source: libpisock/util.c

--- pilot-link-0.11.8/work/pilot-link-0.11.8/libpisock/util.c	2002-07-30
17:52:24.000000000 +0200
+++ pilot-link-0.11.8.patched/work/pilot-link-0.11.8/libpisock/util.c  
2004-10-16 21:46:33.000000000 +0200
@@ -18,7 +18,7 @@
  * You should have received a copy of the GNU General Public License along
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+   THIS FILE WAS PATCHED WITH ISO8859-2 PATCH FOR EVOLUTION CONDUITS */

 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -26,13 +26,14 @@

 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 #include "pi-util.h"

 #ifdef HAVE_ICONV
 #include <iconv.h>
 #endif

-#define PILOT_CHARSET "CP1252"
+#define PILOT_CHARSET "ISO8859-2"

 /***********************************************************************
  *
@@ -51,11 +52,13 @@
		    int bytes, char **ptext)
 {
 #ifdef HAVE_ICONV
-	char	*ib,
+
+	 char	*ib,
		*ob;
	iconv_t cd;
	size_t	ibl, obl;
-
+	
+	
	cd = iconv_open(PILOT_CHARSET, charset);
	if (!cd)
		return -1;
@@ -65,13 +68,13 @@
	ib	= (char *)text;
	*ptext	= ob = malloc(obl);

-	if (iconv(cd, &ib, &ibl, &ob, &obl) == -1)
-		return -1;
+	iconv(cd, &ib, &ibl, &ob, &obl);
	*ob = '\0';

	iconv_close(cd);

	return 0;
+	
 #else
	return -1;
 #endif
@@ -94,11 +97,12 @@
		      int bytes, char **text)
 {
 #ifdef HAVE_ICONV
+
	char	*ib,
		*ob;
	iconv_t cd;
	size_t	ibl, obl;
-
+			
	cd = iconv_open(charset, PILOT_CHARSET);
	if (!cd)
		return -1;
@@ -108,13 +112,13 @@
	ib	= (char *)ptext;
	*text	= ob = malloc(obl);

-	if (iconv(cd, &ib, &ibl, &ob, &obl) == -1)
-		return -1;
+	iconv(cd, &ib, &ibl, &ob, &obl);
	*ob = '\0';

	iconv_close(cd);

	return 0;
+	
 #else
	return -1;
 #endif
Comment 5 Michael Dominic K. 2004-10-16 13:13:52 UTC
Created attachment 41983 [details, diff]
app-pda/pilot-link-0.11.8/work/pilot-link-0.11.8/libpisock/util.c
Comment 6 Michael Dominic K. 2004-10-16 13:16:32 UTC
Ups. sorry for pasting the patch as a comment. The new (diff) file is in the attachment. 

What do you mean by "Have you posted this patch upstream?" ? Should I make a bugzilla entry, and ask some people to test it? 
Comment 7 Alastair Tse (RETIRED) gentoo-dev 2005-01-26 06:32:26 UTC
btw, have the pilot-link developers seen this patch. it doesn't look quite right to me by ignoring the status of iconv, given that possibly there maybe a reason why the check is there.

need to look into this a bit more.
Comment 8 Wulf Krueger (RETIRED) gentoo-dev 2007-12-19 22:34:44 UTC
Is this still a problem?
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2008-03-09 13:52:26 UTC
please get back to us with updated information.