Use iconv(3) in pg_restore to do encoding conversion in the client. This involves a lot of autoconf changes that I'm not 100% sure about, other than that it's pretty straightforward.
I haven't looked into this one yet.
I have verified that the *.m4 files that you have included match the ones available through gettext. In general, the iconv-related config changes look good.
---------------
I wanted to compare the new configure file that is included in the patch with one that I tried generating myself from the new configure.in file modified by your patch. It gives me :
Autoconf version 2.63 is required.
My autoconf is 2.68. Do we have to use 2.63 only ?
---------------
pg_restore.c:
cli_encoding can be declared in the if block.
---------------
pg_restore.c:
get_command_line_encoding() is called twice here :
cli_encoding = get_command_line_encoding();
if (cli_encoding > 0 && AH->encoding != get_command_line_encoding())
---------------
pg_restore.c:
You actually intended to use convert_simple_string_list() rather than convert_string() below: