Amer Neely
2007-02-13 08:52:32 UTC
Hi all.
I'm trying to weed out garbage that comes from copying and pasting stuff
from a web page.
Some of the data has spaces, but a *different* kind of space ... a
char(160) kind ... I think ... I figured this out by copying the space
select ascii(' ');
... where the space was pasted in.
update tmp_AAPT_OnlineAnalyser_ChargeTypeSummary set Service_Number =
replace( Service_Number, char(160), '' );
Query OK, 0 rows affected (0.00 sec)
Rows matched: 313 Changed: 0 Warnings: 0
So it's not finding char(160) in Service_Number. If I try another way to
select ascii( right( Service_Number, 1 ) ) from
tmp_AAPT_OnlineAnalyser_ChargeTypeSummary;
... gives me a big set of results, all 194 ( ie char(194) ). But when I
select char(160), char(194);
+-----------+-----------+
| char(160) | char(194) |
+-----------+-----------+
| <A0> | <C2> |
+-----------+-----------+
... and both the <A0> and <C2> results are in reverse video. The <A0>
*looks* like the stuff I'm getting at the end of fields when I just do a
select from the table in the MySQL command-line client, eg the 1st
0298437600<A0>
( <A0> is reversed ).
Lastly, maybe I shouldn't add this, but when I construct the space
my $space_character = chr(160);
When I do: perl -e "print chr(160);"I'm trying to weed out garbage that comes from copying and pasting stuff
from a web page.
Some of the data has spaces, but a *different* kind of space ... a
char(160) kind ... I think ... I figured this out by copying the space
select ascii(' ');
... where the space was pasted in.
update tmp_AAPT_OnlineAnalyser_ChargeTypeSummary set Service_Number =
replace( Service_Number, char(160), '' );
Query OK, 0 rows affected (0.00 sec)
Rows matched: 313 Changed: 0 Warnings: 0
So it's not finding char(160) in Service_Number. If I try another way to
select ascii( right( Service_Number, 1 ) ) from
tmp_AAPT_OnlineAnalyser_ChargeTypeSummary;
... gives me a big set of results, all 194 ( ie char(194) ). But when I
select char(160), char(194);
+-----------+-----------+
| char(160) | char(194) |
+-----------+-----------+
| <A0> | <C2> |
+-----------+-----------+
... and both the <A0> and <C2> results are in reverse video. The <A0>
*looks* like the stuff I'm getting at the end of fields when I just do a
select from the table in the MySQL command-line client, eg the 1st
0298437600<A0>
( <A0> is reversed ).
Lastly, maybe I shouldn't add this, but when I construct the space
my $space_character = chr(160);
I get: á
This is also with Win2K and ActiveState.
I've been following several threads on character sets and collation as
well. I have a database that contains accented data (Canadian French)
that doesn't render correctly in a browser window. I'm going to try
converting it and the tables to utf8 Unicode. Then make sure the
character set for the HTML is also utf8.
my $sql = "update tmp_AAPT_OnlineAnalyser_ChargeTypeSummary set
Service_Number = replace( Service_Number, '" . $space_character . "', '' )";
it works! But the *exact* same Perl code running on a Linux client fails
( doesn't update the field anyway ). It defies logic.
Who knows what's going on?
--Service_Number = replace( Service_Number, '" . $space_character . "', '' )";
it works! But the *exact* same Perl code running on a Linux client fails
( doesn't update the field anyway ). It defies logic.
Who knows what's going on?
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-***@m.gmane.org
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-***@m.gmane.org