After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 385443 - Characters in Chinese or other languages can't be synced between Palm and Evolution
Characters in Chinese or other languages can't be synced between Palm and Evo...
Status: RESOLVED FIXED
Product: gnome-pilot
Classification: Other
Component: conduit system
2.0.15
Other All
: Normal critical
: ---
Assigned To: gnome-pilot Maintainers
gnome-pilot Maintainers
Depends on:
Blocks: 364618
 
 
Reported: 2006-12-13 13:21 UTC by Jerry Yu
Modified: 2007-01-17 08:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
applications patch (18.36 KB, patch)
2006-12-13 13:22 UTC, Jerry Yu
none Details | Review
patch (20.34 KB, patch)
2006-12-28 07:12 UTC, Jerry Yu
none Details | Review
patch as committed (28.24 KB, patch)
2007-01-14 22:23 UTC, Matt Davey
committed Details | Review
patch to add charset support (as comitted) (28.32 KB, patch)
2007-01-14 23:10 UTC, Matt Davey
committed Details | Review

Description Jerry Yu 2006-12-13 13:21:29 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:
Comment 1 Jerry Yu 2006-12-13 13:22:00 UTC
Created attachment 78286 [details] [review]
applications patch
Comment 2 Matt Davey 2006-12-13 14:09:04 UTC
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.
Comment 3 Jerry Yu 2006-12-27 09:48:30 UTC
Ok, I'll rewrite my patch to preserve compatibility with pilot-link 0.11.8.
I prefer to have it appear but 'greyed out'.
Comment 4 Matt Davey 2006-12-27 11:15:34 UTC
Marking this as NEEDINFO, and will review your revised patch when it appears.

Thanks.
Comment 5 Jerry Yu 2006-12-28 07:12:47 UTC
Created attachment 78974 [details] [review]
patch

It currently works on pilot-link-0.11.8 and pilot-link-0.12.*
Comment 6 Matt Davey 2007-01-02 10:12:27 UTC
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.
Comment 7 Matt Davey 2007-01-11 14:13:38 UTC
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.
Comment 8 Jerry Yu 2007-01-12 10:31:29 UTC
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.
Comment 9 Matt Davey 2007-01-14 22:23:47 UTC
Created attachment 80275 [details] [review]
patch as committed
Comment 10 Matt Davey 2007-01-14 22:25:30 UTC
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...).
Comment 11 Matt Davey 2007-01-14 23:10:45 UTC
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
Comment 12 Jerry Yu 2007-01-17 04:54:24 UTC
Matt, It works well on Solaris. Thanks for your modification.
Comment 13 Matt Davey 2007-01-17 08:16:50 UTC
Great.  Thanks for testing it, and for the patch!