develooper Front page | perl.perl5.porters | Postings from July 2000

utf8 characters

j k
July 31, 2000 11:12
utf8 characters
Message ID:
Hello -

We are using the utf8 pragma to convert latin
characters from an input file to utf8 characters to
insert into the database.  This is how we are using

use utf8;
my $name =~ tr/\0-\xff//UC;

I'm getting 2 errors:  

1)  Malformed utf8 character at line 72...

    (this is the line that has the tr///UC; statement)

2)  When we do an update statement to the database
with the converted $name variable, there is an SQL
error.  We are using a utf8 compliant informix DB. 
The update statement looks like:

update table_name set name=$name where id=$id

The error (-202) says that there is an invalid

Are we using the correct format for using utf8?  Is
the tr///UC statement correct?   Can anyone offer any

Thanks so much!


Do You Yahoo!?
Kick off your party with Yahoo! Invites. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About