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

Re: [perl #131683] Encode::ONLY_PRAGMA_WARNINGS in$PerlIO::encoding::fallback

Thread Previous | Thread Next
From:
pali
Date:
September 12, 2017 07:34
Subject:
Re: [perl #131683] Encode::ONLY_PRAGMA_WARNINGS in$PerlIO::encoding::fallback
Message ID:
20170912073414.GA30648@pali
On Monday 11 September 2017 18:24:43 karl williamson via RT wrote:
> On 09/11/2017 06:13 PM, Tony Cook via RT wrote:
> > One problem with implementing this as XS is the same problem as the goto solution - the call to utf8n_to_uvuni() would only produce warnings if the current context has utf8 warnings enabled, regardless of ONLY_PRAGMA_WARNINGS.
> 
> Note that there is a new API in 5.26 which allows you to get a bit field 
> returned with a bit set for every error encountered in the input character.
> 
> As it says in the docs:
> 
> To do your own error handling, call this function with the 
> C<UTF8_CHECK_ONLY>
> flag to suppress any warnings, and then examine the C<*errors> return.
> 
> 	UV	utf8n_to_uvchr_error(const U8 *s, STRLEN curlen,
> 		                     STRLEN *retlen,
> 		                     const U32 flags,
> 		                     U32 * errors)

That would really help! Thanks for pointer.

> If we get Devel::PPPort maintained, I had hoped to put it there.

But Devel::PPPort is unmaintained... What about taking it into p5p? Or
forking it?

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