in reply to Re^3: Counting bytes in a Unicode document
in thread Counting bytes in a Unicode document

Both of those hacks will fail on Windows or if a decoding error occurs.

  • Comment on Re^4: Counting bytes in a Unicode document

Replies are listed 'Best First'.
Re^5: Counting bytes in a Unicode document
by LanX (Saint) on Oct 08, 2024 at 17:12 UTC
    You mean both bytes hacks, or also removing the utf8 flag manually?

    In any case, isn't that a bug?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      No, it's not a bug that they don't return the size of something that's not passed to them.

      If anything, I would consider using either of those a bug. It's hard to imagine a reason to use them.

        Yes, I don't see a lot of purpose in bytes::length. But if you do want to do that, it's better than removing the utf8 flag and calling the normal length. But I have enormous questions around what the OP is even trying to do in the first place.
        --
        A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |
        > something that's not passed to them.

        You are talking in riddles.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery