Bug 5012 - iconv: client charset used by server process
iconv: client charset used by server process
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.0.0
PPC Mac OS X
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-07 11:58 UTC by Kaarle
Modified: 2008-07-26 10:14 UTC (History)
0 users

See Also:


Attachments
truncate iconv_opt to target charset (471 bytes, patch)
2007-10-07 12:07 UTC, Kaarle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kaarle 2007-10-07 11:58:38 UTC
If rsync-3.0.0pre1 is called like
  
  rsync  --iconv=UTF-8-MAC,UTF-8 SOURCE HOST:DEST

the client charset, here UTF-8-MAC, is forwarded to the server process rather than the specified destination charset UTF-8.  This is due a bug in setup_iconv() where iconv_opt isn't truncated to the destination charset as expected by server_options(...).
Comment 1 Kaarle 2007-10-07 12:07:47 UTC
Created attachment 2938 [details]
truncate iconv_opt to target charset

Added patch to truncate iconv_opt to target charset after parsing.  I'm not sure if it's save in any circumstances but it fixes this bug in the case described above.
Comment 2 Wayne Davison 2007-10-07 15:46:21 UTC
The problem came about due to my repositioning the setup_iconv() function too early in the startup sequence.  I've moved it so that it gets called appropriately for a client, a server, and a local-copy (where we fork a "server").

Thanks for the report!