At 4:35 pm -0800 27/1/06, [EMAIL PROTECTED] wrote:

Hello,

I was doing some I18N of a bunch of existing CGI scripts and
encountered a problem....I have my strings in UTF-8. I read most of them from file,do some processing and spit them out of the CGI-script.

Let say I do this:

  $x=~y/a-ya/A-YA/;


What about this? :

        #!/usr/bin/perl
        use open ':encoding(UTF-8)';
        binmode STDOUT, ":utf8";
        my $file = "/tmp/aja";
        open TEST, $file;
        for (1072..1103) { print TEST chr() };
        close TEST;
        # # # # #
        open SOURCE, $file;
        while (<SOURCE>) {
          for (split //) {
            $lower .= $_;
            s~.+~\U$&~;
            $upper .= "$_";
          }
        }
        print "$lower$/$upper$/";
        print
          substr($lower, 5,5) . $/ .
          substr($upper, 5,5);


What am I doing wrong? If you reply RTFM, I'll understand and will not
complain... :-)

Plenty to read here:

<http://www.google.co.uk/search?hl=en&q=perl+open+encoding&btnG=Google+Search&meta=>

Reply via email to