X-Original-To: pgsql-sql@postgresql.org Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 3B8BD4758E6 for ; Wed, 12 Mar 2003 04:44:44 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 18t2my-0000RU-0Z; Wed, 12 Mar 2003 09:44:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 9D0C316A15; Wed, 12 Mar 2003 09:44:43 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 0296B16236; Wed, 12 Mar 2003 09:44:42 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-2" From: Richard Huxton Organization: Archonet Ltd To: vernonw@gatewaytech.com, pgsql-sql@postgresql.org Subject: Re: Special characters in SQL queries Date: Wed, 12 Mar 2003 09:44:41 +0000 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200303120944.42009.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Archive-Number: 200303/281 X-Sequence-Number: 12321 On Wednesday 12 Mar 2003 3:28 am, Vernon Wu wrote: > Thank Christoph for your information. > > I don't program in C at all, but Java. Although I can make a way to call > the C library function from Java, it isn't suitable solution, I believe. > > I only desire to find out all the type of characters at the present time = so > that I can strip out any potential problem sources in text. Who know what > characters a user will enter. Don't do Java myself, but I can't believe the JDBC (or whatever) classes do= n't=20 do this for you. In any case, you can look at the code for the C function -= =20 it should be fairly obvious what characters it's working on. If you do want to write your own, it's best not to strip certain characters= ,=20 but rather to list those you will allow through. That way if you miss=20 something it's a bug report rather than a security hole. --=20 Richard Huxton