Test::XML not working with UTF-8

Richard Jolly Richard.Jolly at bbc.co.uk
Thu Feb 1 14:10:48 GMT 2007


london.pm-bounces at london.pm.org wrote:
> On 1 Feb 2007, at 11:39, John Ramsden-Developer wrote:
>> Anyway, getting to the point, I wonder if anyone has any ideas why
>> Test::XML fails to recognize UTF-8 characters, or can think of an
>> alternative I might use if Test::XML is no good for UTF-8.
> 
> I think you are using it wrong. You claim to be passing utf8
> to is_xml, but you're actually giving it a perl string. You
> need to actually encode it as utf8 too.

Do you mean than \x{263A} is not sufficient to mark the string as utf8? I thought it was:

perl -C2 -MEncode -e '$s = "\x{263A}"; $is_is_not = Encode::is_utf8($s) ? "is" : "is NOT"; print "$s $is_is_not utf8\n";'

☺ is utf8

> Read about perl strings and byte sequences here:
> 
> 	http://jerakeen.org/talks/perl-loves-utf8/

thanks,

Richard


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					



More information about the london.pm mailing list