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

Re: [perl #113824] Regexp error messages are not UTF8-clean

Thread Previous | Thread Next
From:
demerphq
Date:
June 18, 2013 20:09
Subject:
Re: [perl #113824] Regexp error messages are not UTF8-clean
Message ID:
CANgJU+WhzAqOHGabPNbMaaOnYtEtasRmRt5kHRU_bBcNsxwDYg@mail.gmail.com
On 18 June 2013 21:47, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Tue Jun 18 08:36:45 2013, demerphq wrote:
>> On 18 June 2013 15:29, Father Chrysostomos via RT
>> <perlbug-followup@perl.org> wrote:
>> > On Tue Jun 18 06:17:15 2013, sprout wrote:
>> >> All our printf-style functions *do* support utf8, but just not as a
>> >> separate flag.  The input must be a HEK or SV.  Look for instances of
>> >> HEKf and SVf in the perl source.
>> >>
>> >> Now, it has just occurred to be that it would not be at all hard to add
>> >> support for utf8 char*s.  We have pretty much infinite space in %-p
>> >> formats, so we can define %-4p to whatever we want.
>> >>
>> >> The latter would not be necessary for fixing this bug, but it may be a
>> >> good thing to do anyway, and it might turn out to be the simplest
> way to
>> >> fix this bug.
>> >
>> > And this is what it would look like in practice;
>> >
>> > Perl_croak("Couldn't twiggle the twoggle in \"%"UTF8f"\"", is_utf8, s);
>> >
>> > UTF8f could take two arguments, the first being a boolean.  That would
>> > be the most useful way to implement it.
>>
>> Very nice idea! ++FC.
>
> We need the length, too.  Which order should they come?  is_utf8, len, str?

Well that is the order I would expect for a sprintf() type format like this.

cheers,
Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About