Fix psql crash while parsing SQL file whose encoding is different from client encoding and the client encoding is not *safe* one. Such an example is, file encoding is UTF-8 and client encoding SJIS. Patch contributed by Jiang Guiqing.
Fix psql crash while parsing SQL file whose encoding is different from
client encoding and the client encoding is not *safe* one. Such an
example is, file encoding is UTF-8 and client encoding SJIS. Patch
contributed by Jiang Guiqing.

CraigHarris/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,rvs/gpdb,kaknikhil/gpdb,edespino/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,Chibin/gpdb,lintzc/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,janebeckman/gpdb,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,lintzc/gpdb,adam8157/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,royc1/gpdb,xinzweb/gpdb,cjcjameson/gpdb,50wu/gpdb,kaknikhil/gpdb,adam8157/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,adam8157/gpdb,zaksoup/gpdb,xuegang/gpdb,adam8157/gpdb,royc1/gpdb,xuegang/gpdb,Quikling/gpdb,edespino/gpdb,greenplum-db/gpdb,chrishajas/gpdb,0x0FFF/gpdb,ahachete/gpdb,janebeckman/gpdb,CraigHarris/gpdb,CraigHarris/gpdb,janebeckman/gpdb,xuegang/gpdb,janebeckman/gpdb,Chibin/gpdb,yuanzhao/gpdb,Quikling/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,xuegang/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,50wu/gpdb,lisakowen/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,Chibin/gpdb,ahachete/gpdb,lisakowen/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,chrishajas/gpdb,adam8157/gpdb,rvs/gpdb,zaksoup/gpdb,Quikling/gpdb,50wu/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,Quikling/gpdb,kaknikhil/gpdb,chrishajas/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,Chibin/gpdb,edespino/gpdb,rvs/gpdb,xuegang/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,xinzweb/gpdb,rvs/gpdb,xuegang/gpdb,royc1/gpdb,adam8157/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,xinzweb/gpdb,janebeckman/gpdb,rvs/gpdb,ahachete/gpdb,royc1/gpdb,ashwinstar/gpdb,xinzweb/gpdb,yuanzhao/gpdb,Quikling/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,janebeckman/gpdb,rvs/gpdb,chrishajas/gpdb,Chibin/gpdb,lisakowen/gpdb,zaksoup/gpdb,ahachete/gpdb,50wu/gpdb,Quikling/gpdb,Chibin/gpdb,Quikling/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,lintzc/gpdb,ahachete/gpdb,ahachete/gpdb,xuegang/gpdb,CraigHarris/gpdb,lintzc/gpdb,edespino/gpdb,lintzc/gpdb,Chibin/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,0x0FFF/gpdb,janebeckman/gpdb,rvs/gpdb,yuanzhao/gpdb,zaksoup/gpdb,0x0FFF/gpdb,royc1/gpdb,rvs/gpdb,zaksoup/gpdb,cjcjameson/gpdb,zaksoup/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,adam8157/gpdb,janebeckman/gpdb,Chibin/gpdb,Chibin/gpdb,royc1/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,lisakowen/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,rvs/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,lisakowen/gpdb,50wu/gpdb,royc1/gpdb,xinzweb/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,Quikling/gpdb,janebeckman/gpdb,zaksoup/gpdb,edespino/gpdb,xuegang/gpdb,Quikling/gpdb,rvs/gpdb,edespino/gpdb,lisakowen/gpdb,50wu/gpdb,ahachete/gpdb,xuegang/gpdb,ahachete/gpdb,zaksoup/gpdb,lintzc/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,Quikling/gpdb,edespino/gpdb,lintzc/gpdb,chrishajas/gpdb,lintzc/gpdb,chrishajas/gpdb,xinzweb/gpdb,kaknikhil/gpdb,edespino/gpdb,adam8157/gpdb,chrishajas/gpdb,edespino/gpdb,jmcatamney/gpdb,lisakowen/gpdb,ashwinstar/gpdb,chrishajas/gpdb,Chibin/gpdb,lintzc/gpdb,edespino/gpdb,janebeckman/gpdb,50wu/gpdb,royc1/gpdb