Permalink
Browse files

Work on a fixed width string.

Sadly, this can't actually be merged yet, for the same reason we can
not substr strings in the grammar from fixed width.
  • Loading branch information...
1 parent f843f61 commit 11e00a92e4a839868d99b482c9098fc33c5b1eec @jnthn jnthn committed Sep 19, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/Str.pm
View
@@ -738,9 +738,10 @@ my class Str does Stringy {
method words(Str:D: $limit = $Inf) {
my $taken = 0;
- my str $str = nqp::unbox_s(self);
- my int $eos = nqp::chars($str);
- my int $pos = 0;
+ my str $orig = nqp::unbox_s(self);
+ my str $str = pir::trans_encoding__Ssi($orig, pir::find_encoding__Is('ucs4'));
+ my int $eos = nqp::chars($str);
+ my int $pos = 0;
gather while $taken < $limit {
my int $start = nqp::findnotcclass(
pir::const::CCLASS_WHITESPACE, $str, $pos, $eos);

0 comments on commit 11e00a9

Please sign in to comment.