should it be replaced with nothing or with a NULL? Does the perl pointer jump to the next character automatically when a match is made thus skipping a character in your replace? Does a double run fix it?<br><br><div class="gmail_quote">
On Thu, Mar 31, 2011 at 12:04 PM, Geoffrey Myers <span dir="ltr"><<a href="mailto:lists@serioustechnology.com">lists@serioustechnology.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So, we are trying to convert a number of postgresql databases that were<br>
created with SQL_ASCII encoding to UTF8 encoding. As such, I need to<br>
strip certain characters out of the data before dumping and reloading<br>
the new databases. I'm using the following:<br>
<br>
data =~ s/(.)/((ord($1) >= 0) && (ord($1) <= 8))<br>
|| (ord($1) == 11)<br>
|| ((ord($1) >= 13) && (ord($1) <= 31))<br>
|| ((ord($1) >= 127)) ?"": $1/egs;<br>
<br>
Yet I'm getting the following error, which indicates a character that<br>
should be handled by the above code is still in the data:<br>
<br>
pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte sequence<br>
for encoding "UTF8": 0xbd<br>
<br>
<br>
Certainly, the above code should replace the 0xbd with nothing?<br>
<br>
Any perl/postgres gurus out there?<br>
<br>
--<br>
Until later, Geoffrey<br>
<br>
"I predict future happiness for America if they can prevent<br>
the government from wasting the labors of the people under<br>
the pretense of taking care of them."<br>
- Thomas Jefferson<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br>I would rather stumble along in freedom than walk effortlessly in chains.<br><br><br>