Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Unicode surrogate is illegal in UTF-8

by Rodster001 (Pilgrim)
on Aug 03, 2015 at 20:33 UTC ( [id://1137296]=note: print w/replies, xml ) Need Help??


in reply to Re: Unicode surrogate is illegal in UTF-8
in thread Unicode surrogate is illegal in UTF-8

Could I generate/detect this warning without using "print" (i.e. so I could fix/replace silently)?
  • Comment on Re^2: Unicode surrogate is illegal in UTF-8

Replies are listed 'Best First'.
Re^3: Unicode surrogate is illegal in UTF-8
by choroba (Cardinal) on Aug 03, 2015 at 21:23 UTC
    You can print to a filehandle that doesn't lead anywhere:
    open my $VOID, '>', \ my $void; 1 until eval { print {$VOID} $text->{string}; # ...
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^3: Unicode surrogate is illegal in UTF-8
by afoken (Chancellor) on Aug 05, 2015 at 03:33 UTC
    Could I generate/detect this warning without using "print" (i.e. so I could fix/replace silently)?

    Have a look at Handling Malformed Data.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1137296]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found