GNOME Bugzilla – Bug 385443
Characters in Chinese or other languages can't be synced between Palm and Evolution
Last modified: 2007-01-17 08:16:50 UTC
Please describe the problem: Characters in Chinese or other languages can't be synced between Palm and Evolution Steps to reproduce: Connect Palm Treo600 with x86 or Sparc machine by USB port. Install latest Gnome Pilot and pilot-link pkgs for USB port . 1.Write some Chinese words on To Do List in Palm and some different Chinese words on Tasks in Evolution on Solaris platform. 2.Enable synchronization at the EToDo conduit in Pilot Settings. Actual results: The words synced from Palm display as garbage codes in Evolution, and the words synced from evolution display as marks "???" in Palm. Expected results: The character should be synced successfully. Does this happen every time? yes Other information:
Created attachment 78286 [details] [review] applications patch
Jerry, this is an excellent feature to add. There are a couple of issues, though. First, we need to preserve compatibility with pilot-link 0.11.8 for a little while yet. This means that the new pilot-link API will have to be conditional. We could make the new gnome-pilot GUI appear only when compiled against 0.11.8, but it might be better (and easier?) to have it appear but 'greyed out'. What do you think? Also, I'll need to verify that your changes don't cause problems when migrating from existing configs that don't have the new 'charset' parameters, such as would be the case when upgrading.
Ok, I'll rewrite my patch to preserve compatibility with pilot-link 0.11.8. I prefer to have it appear but 'greyed out'.
Marking this as NEEDINFO, and will review your revised patch when it appears. Thanks.
Created attachment 78974 [details] [review] patch It currently works on pilot-link-0.11.8 and pilot-link-0.12.*
Thanks, I'll take a look when I get a chance. I'm sure you've noticed, by the way, that gnome has migrated to subversion, so changes will show up there, not in CVS.
Jerry, your use of convert_FromPilotChar_WithCharset supplies a NULL pi_charset argument. Is that intended? Should you use the user-supplied charset instead? Other comments: What about support for existing conduits that use 'convert_ToPilotChar'? What about users who are already using the PILOT_CHARSET environment variable? I think we can support both the above cases by: 1. If the config-file value is set, use it. 2. Otherwise, if PILOT_CHARSET is set, we initialise the config file value from PILOT_CHARSET. 3. Otherwise, initialise to CP1252 as a default. 4. gpilotd should override the environment variable PILOT_CHARSET with the config-file value. This way, when people upgrade to gp 2.0.16 we should be able to migrate any usage of PILOT_CHARSET into your new GUI-supported configuration. What do you think? Have I missed anything? I'm happy to make the above changes when I apply your patch, by the way. I should get around to it this weekend, with any luck.
I set NULL pi_charset argument to convert_FromPilotChar_WithCharset here because I think the username don't need the conversion. In another patch for evolution conduits, the pi_charset argument is set to the user-supplied charset. I totally agree with you to support both cases you mentioned here. Actually when we were fixing the bug, we thought about two way: one is using PILOT_CHARSET environment by which the APIs 'convert_ToPilotChar' and 'convert_FromPilotChar' aren't need to be changed, the other is the way my patch applied. At last, we selected the second one. I think the idea you said here is great, which is nice for the users.
Created attachment 80275 [details] [review] patch as committed
Okay, finally committed, with a few changes (see attached diff). The main changes to Jerry's patch were: 1. Initialise charset from PILOT_CHARSET environment variable, if it hasn't been set in the config file, otherwise default to CP1252. This defaulting is done both in gpilotd_control_applet and gpilotd. This should mean a seamless migration for users whether or not they are using PILOT_CHARSET at present. 2. sanity check supplied charset values are recognised by iconv_open, in the druid, capplet, and gpilotd. 3. set PILOT_CHARSET environment variable from configured value before starting sync. This allows conduits that use PILOT_CHARSET to continue to function. 4. Indentation of tooltip text on settings, and change to tooltip text. Jerry, I've tested a reasonable amount, but it would be good if you could check all seems to be working okay (as I am a CP1252 user...).
Created attachment 80279 [details] [review] patch to add charset support (as comitted) Update to previous patch, to fix compatibility with pilot-link 0.11.8
Matt, It works well on Solaris. Thanks for your modification.
Great. Thanks for testing it, and for the patch!