X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 49B3732BBA3 for ; Wed, 13 Oct 2004 21:59:11 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34240-06 for ; Wed, 13 Oct 2004 20:59:06 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C5F2932BB90 for ; Wed, 13 Oct 2004 21:59:06 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CHq3O-00075y-00; Thu, 14 Oct 2004 09:48:58 +1300 Message-ID: <416D94B8.1020501@opencloud.com> Date: Thu, 14 Oct 2004 09:48:56 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Sykes Cc: pgsql-jdbc@postgresql.org Subject: Re: odd insert problem, textarea \n replaced with
gives References: <7d68b7e304101311007923fb7f@mail.gmail.com> In-Reply-To: <7d68b7e304101311007923fb7f@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200410/123 X-Sequence-Number: 11228 Andrew Sykes wrote: > I've got a textarea in a JSP page, and I'm replacing the newline > characters in the box with
using a regular expression. When I > output the result of this to the page as a test, everything looks fine > (i.e.
's in the page source). Is it possible that the replacement is actually not working, and something is translating ^M to
on page output? Perhaps try writing the string directly to a file or System.err to check? > I pass this String to a method of a bean that does the inserting into > the DB, and it appears to work fine; but when I use pgsql to check, I > see that the
bit of the string has been replaced by a number of > highlighted ^M characters. I suspect that something between your code and the JDBC driver is not actually doing what you think it's doing. The driver knows nothing about HTML escapes or CR/LF in strings, it just passes them on to the backend. -O