in reply to Re: Behaviour of Encode::decode_utf8 on ASCII
in thread Behaviour of Encode::decode_utf8 on ASCII

Except there is the issue of efficiency (see my other post above). Representing a string of characters which all happen to lie within the ASCII range as an untagged byte string allows the byte-oriented regex engine to be used.

It's a very similar idea to using machine words to hold integers up to a certain value, and then switching to a different representation for bignums. It doesn't make a difference to correctness, but it does make a difference to performance.

  • Comment on Re^2: Behaviour of Encode::decode_utf8 on ASCII

Replies are listed 'Best First'.
Re^3: Behaviour of Encode::decode_utf8 on ASCII
by demerphq (Chancellor) on Feb 16, 2007 at 23:14 UTC

    To repeat what i said elsewhere, IMO this is a bug that should be reported.

    Id do it for you, but using perlbug on win32 is a real PITA.

    ---
    $world=~s/war/peace/g