develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #113994] [META] seek and tell operate on bytes

Thread Previous | Thread Next
Ricardo Signes
September 7, 2013 12:14
Re: [perl #113994] [META] seek and tell operate on bytes
Message ID:
* Leon Timmermans <> [2013-09-07T03:51:14]
> On Fri, Sep 6, 2013 at 3:35 AM, Ricardo Signes <>wrote:
> > My understanding is that there exist encodings where we cannot so easily
> > determine our position (whether we are mid-sequence or not).  I don't know
> > of any off hand, though.  What about those?  I really think the answer is
> > going to be along the lines of "the layer can try to help tell you that you
> > messed up, but don't *do* that.
> iso-2022 is the most notorious one, though I'm not sure people use it
> outside of MIME. Shift-JIS is another one. Though even UTF-16 can have the
> issue if you're silly enough to do an odd seek.
> This is all very "Doctor, it hurts when I press here" to me.

Yes, as I said: don't *do* that  :-)

Oh, and with UTF-16, so I see!  It hadn't occurred to me, but it's painfully
obvious, isn't it?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About