Follow-up Comment #4, bug #4834 (project savane):
I was about to go with such test but it does not work: decode_utf8 behave
differently depending on perl version. And the wanted behavior is available
in older ones...
(see http://aspn.activestate.com/ASPN/Mail/Message/perl5-porters/2922678)
sub IsUTF8 {
return 1 if $_[0] eq 0;
return 1 if $_[0] eq '';
return 1 if decode_utf8($_[0]);
return 0;
}
Also, putting the content into comments does not work either: xml parsers
like xsltproc does not want non-utf8 into comment.
I dont think there is any interesting solution for now.
http://search.cpan.org/~markf/Test-utf8-0.02/lib/Test/utf8.pm would do the
trick nicely, but it is not about to be available for production servers.
So people with invalid data are likely to have to edit it...
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?func=detailitem&item_id=4834>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Savane-dev mailing list
[email protected]
https://mail.gna.org/listinfo/savane-dev