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

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.

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

Replies are listed 'Best First'.
Re^7: Counting bytes in a Unicode document
by ysth (Canon) on Oct 09, 2024 at 20:39 UTC
    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(θ)| |
Re^7: Counting bytes in a Unicode document
by LanX (Saint) on Oct 09, 2024 at 01:06 UTC
    > 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

      If you don't pass the file to them, they can't return the length of the file, and it's not a bug that they don't.

        Ysth and I referenced bytes and showed code to get the byte length of a Unicode string

        You replied

        > Both of those hacks will fail on Windows

        Now you are talking about not passing a file ...???

        Either bytes::length() works on Windows or it's buggy and the documentation should be fixed.

        Updates

        In hindsight, what you probably tried to say is that the OP had a problem with successfully reading the file on Windows.

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