Gossamer Forum
Home : General : Perl Programming :

Foreign Charachters?

Quote Reply
Foreign Charachters?
Can anyone see any reason why this script won't work? All I need it to do is loop through the two fields, printing out the SQL statements, ready to be run via MySQLMan. I'm thinking it must be the foreign charachters messing up the script. I am getting a 500 IS Error, but because I'm running it locally, there is no debugging info, and fatalsToBrowser is not picking anything up Frown

The code is;

Code:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
#use strict;

print "Content-type: text/html \n\n";

# for link stuff...
#my @fields = qw(Title Description);


# can overwrite here... :)
my @fields = qw(Name Full_Name);

foreach (@fields) {

print qq|UPDATE lsql_Category SET $_ = REPLACE($_, '\','')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ñ', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ó', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ú', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'é', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'á', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ü', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'É', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'Ó', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, '\\\'', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'à', ' ')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ç', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ï', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'è', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'À', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'Í', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'Ú', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ë', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'Ñ', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'î', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'î', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'È', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ä', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'ê', '')\;|;
print qq|UPDATE lsql_Category SET $_ = REPLACE($_, 'î', 'i')\;|;
}

print "done";

Thanks for any help you can offer :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Foreign Charachters? In reply to
>>
but because I'm running it locally, there is no debugging info
<<

What do you mean?...I run scripts locally, they print errors to STDERR like normal.

Why are you escaping all those semi-colons?

I'm guessing your error is due to this:

'\'

You are escaping the string terminator which will cause an error.

Last edited by:

Paul: Jan 3, 2003, 9:13 AM
Quote Reply
Re: [Paul] Foreign Charachters? In reply to
I fixed this problem a long time ago (ended up doing it manually). Thanks for the reply though Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Foreign Charachters? In reply to
Just writing a plugin, which creates DirName field values based on Full_Name field which contains foreign chars. In case it may be useful you, not sure tough.
EDIT: Oh, I see your problem is solved.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Jan 7, 2003, 7:49 AM