Subject: | Trouble handling Unicode strings |
Date: | Mon, 11 Jan 2010 11:27:46 +0100 |
To: | bug-data-amf [...] rt.cpan.org |
From: | Bjoern Hoehrmann <derhoermi [...] gmx.net> |
Hi,
It seems there is a problem serializing Unicode data, consider for
example:
% perl -MEncode -MData::AMF -e "print Data::AMF->new(
version => 3)->serialize(qq|\x{20AC}|)"
Wide character in print at -e line 1.
I would probably use Encode::encode_utf8 on any string that has the
UTF-8 flag set before writing (assuming AMF uses UTF-8 as encoding),
but at least some warning should be included in the documentation
(this actually results in corrupted data in some cases, but encoding
the data before passing it to the serialization function fixes that).
regards,
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/