On Sun Jun 07 00:57:34 2009, patmar19 wrote:
> When I try pugs or perl6 I get strange results whith Str methods :
> 
> pugs -e 'say "1234é".chars' => 5
> perl6 -e 'say "1234é".chars' => 6
> 
> pugs -e 'say "1234é".bytes' => 6
> perl6 -e 'say "1234é".bytes' => 8
> 
> pugs -e 'say "1234é".graphs' => 5
> perl6 -e 'say "1234é".graphs' => Method 'graphs' not found for invocant of
> class 'Str'

Rakudo's issue here is the handling of utf8 characters coming from the
command line or standard input(Parrot gives them to us as a fixed_8
encoding).  

If you run the above from a file, you'll get more consistent results:

  $ cat x
  say "1234é".chars;
  say "1234é".bytes;
  $ ./perl6 x
  5
  6
  $ 

I have a request in to the Parrot development team for clarification on
converting things to utf8, but no response yet.

Pm


The issue here is Parrot's handling of utf8 characters coming from the
command line.  If you try it from the interactive mode or from a file, y



Reply via email to