Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 11e00a92e4a839868d99b482c9098fc33c5b1eec 1 parent f843f61
@jnthn jnthn authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/Str.pm
View
7 src/core/Str.pm
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.