Wampa has asked for the wisdom of the Perl Monks concerning the following question:

Yesterday I posted here problem and today I have solution. It is fantastic. This site is perfect with perfect monks with perfect knowledges.

I have next problem with encoding Slovak language characters. Below is code where the first array is corect but second array contain Slovak characters and when I execute code the page crash and show error [1572]ERR: 24: Error in Perl code: (in cleanup) Unrecognized character \xED at d:\sukromne\www\epl\calendar.html line 5. Corect

%mesiac=(1=>Januar, 2=>Februar, 3=>Marec, 4=>April, 5=>Maj, 6=>Jun, 7= +>Jul, 8=>August, 9=>September, 10=>Oktober, 11=>November, 12=>Decembe +r);</br>
Incorect
%mesiac=(1=>Január, 2=>Február, 3=>Marec, 4=>Apríl, 5=>Máj, 6=>Jún, 7= +>Júl, 8=>August, 9=>September, 10=>Október, 11=>November, 12=>Decembe +r);

Is some way how I would be able stored Slovak characters in variables ????

Excuse my bad English !!!

Replies are listed 'Best First'.
Re: Slovak language characters
by Abigail-II (Bishop) on Feb 12, 2004 at 10:53 UTC
    Just put the month names in quotes, and everything will be fine. Now you are treating them as bare words, and bare words have to look like indentifier names. Identifier names can only contain the letters 'a' to 'z' (any case), digits and underscores.

    Abigail

      Thank you very much. Now is all OK and work fine.

      Excuse my bad English !!!
      Plus :: and ' (treated as ::):
      $ perl -wle"print STDOUT I'm::a::bareword" I::m::a::bareword

        I don't understand what do you thing with this code???

        Plus :: and ' (treated as ::): $ perl -wle"print STDOUT I'm::a::bareword" I::m::a::bareword
        Programing in Embperl and all questions are related to Embperl.
        Excuse my bad English !!!
Re: Slovak language characters
by leriksen (Curate) on Feb 12, 2004 at 11:02 UTC
    > Excuse my bad English !!!

    compared to my Slovak, it's fantastic !!!

    +++++++++++++++++
    #!/usr/bin/perl
    use warnings;use strict;use brain;

Re: Slovak language characters
by ysth (Canon) on Feb 12, 2004 at 11:09 UTC
    You should be quoting string constants, like "Februar". Perl will let you not do so under certain circumstances, but for many of these circumstances it isn't recommended. Put use strict; use warnings; at the beginning of your code, and you will be required to quote your strings where it's a good idea to.

      Very important. I put use strict; and use warnings; and show me many warnings. I must clean my code.

      Excuse my bad English !!!
Re: Slovak language characters
by Stevie-O (Friar) on Feb 13, 2004 at 04:11 UTC
    Incidentally, why are you using a hash for this? The month numbers are sequential;
    @mesiac = qw(Január Február Marec Apríl Máj Jún Júl August September O +któber November December);
    The only difference is that the arrays are 0-based; you'd do $mesiac[0] for January instead of $mesiac{1}.
    --Stevie-O
    $"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc

      Thanks. It is another way do it. I try it.

      Programing in Embperl and all questions are related to Embperl.
      Excuse my bad English !!!