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

> 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

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

Replies are listed 'Best First'.
Re^8: Counting bytes in a Unicode document
by ikegami (Patriarch) on Oct 09, 2024 at 18:36 UTC

    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

        I think the concern ikegami had is that the string will have crlf as two bytes where the file only had one.
        --
        A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |

        There's nothing sudden about mentioning files. You seem to have forgotten the question is about the length of a file?

        So I repeat: Your "solution" of counting the bytes used to store the decoded file isn't always going to be correct.

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

        No. I clearly said it's your hack that will fail.