Re: comparing binary strings
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Mon, 10 Dec 2007 21:38:02 +0000
Quoth Joost Diepenmaat <joost@xxxxxxxxx>:
On Mon, 10 Dec 2007 14:27:12 +0000, Ben Morrow wrote:
You can't. You need to perform *the comparisons* under 'use bytes'.
No, you don't need to. The only time the encoding of the strings is
important is when you're passing them to external code as a C-style char*
pointer. Or at least it should be.
I agree, it should be; it's not, however. For instance, under 5.8.8, a
string containing "\xc1" (capital A acute) will match /\w/ if it is
utf8-encoded and not if its not. I'm not sure if this is fixed in 5.10;
I'm not sure, either, what the correct fix would be.
Ben
.
- Follow-Ups:
- Re: comparing binary strings
- From: Joost Diepenmaat
- Re: comparing binary strings
- References:
- comparing binary strings
- From: Yakov
- Re: comparing binary strings
- From: Ben Morrow
- Re: comparing binary strings
- From: Joost Diepenmaat
- comparing binary strings
- Prev by Date: Re: How to execute tar inside a perl script ?
- Next by Date: Re: How to execute tar inside a perl script ?
- Previous by thread: Re: comparing binary strings
- Next by thread: Re: comparing binary strings
- Index(es):
Relevant Pages
|