Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJQmo-002wSg-E2 for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:21:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tJQml-00A38c-9N for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Dec 2024 05:21:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJQmk-00A38U-Vf for pgsql-bugs@lists.postgresql.org; Fri, 06 Dec 2024 05:21:52 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJQme-001Ixn-W6 for pgsql-bugs@lists.postgresql.org; Fri, 06 Dec 2024 05:21:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=u+veaF0YoBwEpvzObn6LGH/+oPCJpdspBgK9ylPdR28=; b=HcFSVl+hB2Id5rW58ota74FxHZ qCcaSgYB3TmAzJLRf/xdd02p3RgJlKErRcpCMAekn5A3WJhDDOnljGHLZmxM2Xt6eNdhlEjYxsWOf KudGCAK/MuylpJ7fL3Z+tTh7i6lAwABWZEt7jwvY1x64VdNDjbqciscA1bSOdKnWxQHAjvMKfolVz aJy3f9Us/NbmOEZnqk6wJH3NP10yErh9QDZhKFNFRJnKy0cRdGHrRlenAbFcfvSt255V0NvFo6Pwm aUqY9l2w9/ASLzMG3u68gjQgMk+94R7XQcEUxxoNgjmWNiWglFGSlPBtYj/Tmu7CDZXC9sERVJ7vS eHIeZQAw==; Received: from 221x241x223x178.ap221.ftth.ucom.ne.jp ([221.241.223.178] helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1tJQmZ-003rIe-KM; Fri, 06 Dec 2024 05:21:43 +0000 Date: Fri, 06 Dec 2024 14:21:30 +0900 (JST) Message-Id: <20241206.142130.1661155698933375612.ishii@postgresql.org> To: tgl@sss.pgh.pa.us Cc: koichi.dbms@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18735: Specific multibyte character in psql file path command parameter for Windows From: Tatsuo Ishii In-Reply-To: <2572359.1733424649@sss.pgh.pa.us> References: <18735-4acdb3998bb9f2b1@postgresql.org> <2572359.1733424649@sss.pgh.pa.us> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > I don't believe Shift-JIS uses '/' as part of multibyte characters, Correct. > so it should be sufficient to consider '\'. Agreed. > BTW, according to wikipedia[1], backslash is not even part of the > Shift-JIS character set: > > The single-byte characters 0x00 to 0x7F match the ASCII encoding, > except for a yen sign (U+00A5) at 0x5C and an overline (U+203E) at > 0x7E in place of the ASCII character set's backslash and tilde > respectively (these deviations from ASCII align with JIS X > 0201). The single-byte characters from 0xA1 to 0xDF map to the > half-width katakana characters found in JIS X 0201. > > For double-byte characters, the first byte is always in the range > 0x81 to 0x9F or the range 0xE0 to 0xEF (these ranges are > unassigned in JIS X 0201). If the first byte is odd, the second > byte must be in the range 0x40 to 0x9E (but cannot be 0x7F); if > the first byte is even, the second byte must in the range 0x9F to > 0xFC. > > This might mean that it'd be okay to just skip the backslash-to-slash > conversion loops altogether if we think the encoding is Shift-JIS. I suggest to not do so because majority of Shift-JIS users treat 0x5C as a backslash. They understand that a 0x5C means a backslash in Shift-JIS files if the files are for programming (source code) or for the technical documentations and so on. Best reagards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp