Обсуждение: BUG #6282: psql.exe cannot recognize specific 2byte SJIS character
The following bug has been logged online: Bug reference: 6282 Logged by: Email address: ikezawa@tjsys.co.jp PostgreSQL version: 9.1.1 Operating system: Windows XP Description: psql.exe cannot recognize specific 2byte SJIS character Details: psql.exe cannot recognize specific 2byte SJIS characters. These characters have '\'(0x5c) in low byte of 2 Bytes.
On Wed, Nov 2, 2011 at 09:52, <ikezawa@tjsys.co.jp> wrote: > Bug reference: =C2=A0 =C2=A0 =C2=A06282 > PostgreSQL version: 9.1.1 > Operating system: =C2=A0 Windows XP > Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0psql.exe cannot recognize specifi= c 2byte SJIS character > Details: > psql.exe cannot recognize specific 2byte SJIS characters. > > These characters have '\'(0x5c) in low byte of 2 Bytes. Please send reproducible input pattern. I saw expected results as long as client encoding is set to SJIS: postgres=3D# \encoding SJIS postgres=3D# SELECT '=E8=A1=A8' AS "=E3=82=BD"; =E3=82=BD ---- =E8=A1=A8 (1 =E8=A1=8C) --=20 Itagaki Takahiro
Dear Itagaki-san, Please, no flames about my bad English. Sorry for the delay in getting back to you. It seemed that I gave the insufficient information about psql.exe error. For example, there is the following folder structure. C:\構築フォルダ └A_TBL.sql Type the folowing command line in a command prompt and I can get the error message. C:\>psql --file="構築フォルダ\A_TBL.sql" --dbname=testdb --output="psql.csv" --n o-align --tuples-only --field-separator="," --host=localhost --port=5432 --usern ame=testsuer --no-password ・築フォルダ/A_TBL.sql: No such file or directory C:\> With best regards, K.Ikezawa (2011/11/02 14:32), Itagaki Takahiro wrote: > On Wed, Nov 2, 2011 at 09:52,<ikezawa@tjsys.co.jp> wrote: >> Bug reference: 6282 >> PostgreSQL version: 9.1.1 >> Operating system: Windows XP >> Description: psql.exe cannot recognize specific 2byte SJIS character >> Details: >> psql.exe cannot recognize specific 2byte SJIS characters. >> >> These characters have '\'(0x5c) in low byte of 2 Bytes. > > Please send reproducible input pattern. > > I saw expected results as long as client encoding is set to SJIS: > > postgres=# \encoding SJIS > postgres=# SELECT '表' AS "ソ"; > ソ > ---- > 表 > (1 行)
On 11/08/2011 10:47 AM, æ± æ¾¤ åæ² wrote: > Dear Itagaki-san, > > Please, no flames about my bad English. > > Sorry for the delay in getting back to you. It seemed that I gave the > insufficient > information about psql.exe error. > > For example, there is the following folder structure. > > C:\æ§ç¯ãã©ã«ã > âA_TBL.sql > > Type the folowing command line in a command prompt and I can get the > error message. > > C:\>psql --file="æ§ç¯ãã©ã«ã\A_TBL.sql" --dbname=testdb If I recall correctly, in shift-JIS, the backslash does not exist. Its code point was re-used for the Yen symbol (Â¥) instead. On Shift-JIS windows the Yen symbol is used as a path separator. http://en.wikipedia.org/wiki/Shift_JISw http://blogs.msdn.com/b/oldnewthing/archive/2005/10/14/481044.aspx You will need to use psql in a Unicode command prompt where the backslash character is available. Alternately you might be able to use Â¥ as a directory separator instead, so try: C:\>psql --file="æ§ç¯ãã©ã«ãÂ¥A_TBL.sql" --dbname=testdb ... or use the UNIX-style path separators that Windows understands and accepts just fine: C:\>psql --file="æ§ç¯ãã©ã«ã/A_TBL.sql" --dbname=testdb -- Craig Ringer