>Solution - your conversion of external data should be
>
>  my $string = decode($encoding, $binary);
>  utf8::upgrade($string);
>
>This should be platform independent and work - always. Perl's string 
>functions should all work OK on $string.

So you are saying that if I change

        $var = decode("utf8",$row->{ATT_BOOKING_COMMENT_TXT}) ;

to 

        $var = decode("utf8",$row->{ATT_BOOKING_COMMENT_TXT}) ;
        utf8::upgrade($var );

it will be more resilient and cater for more cases than just the decode
option.

And you also agree that I need to do this to use the Perl string functions?

Regarding:

> 'use utf8;' Is not needed anywhere here of course as it indicates that 
> the source code is encoded in UTF-8. Nothing more. Functions 
> utf8::upgrade etc. are always available.

Normally I use translate, so I don't need to 'use utf8;', but data
structures are language dependent, eg address, it's not just zip-code versus
post-code, but also the sequence of fields, sometimes the street number goes
first, sometimes last, sometimes you validate 'state' sometimes not.  And in
these cases I started using imported XRC, but actually it was easier to just
code it by language, hence, 'use utf8;'

Thanks Mark,

Regards

Steve

Reply via email to