Robin Berjon wrote:
Christopher H. Laco wrote:

On a side note, L::C::Format can just return the symbol,, but it's unclear what encoding it is actually in. That is why I was shooting for the &#x0000 encoding method instead.


Have you tried that option of getting just the character?


Yes, and I just get a ? in the resultant XML, even though it is all declared as UTF-8. I suspect that L::C::Format is returning it in UTF-16.

Just a quick browse through the L::C::Format code shows that it's stored in a few forms, one of which is \x{00A5}.

That's why I went with always wanting FMT_HTML, that 'just works' works regardless of if the target XML is UTF-8, UTF-16, or most other encodings depending on the symbol in question.

XSP happens in Perl land (it's just a way of generating Perl code after all) and it's therefore highly likely that it'll play well with other modules. Especially if you're running 5.8.

As a rule of thumb there are only two situations when escaping should be used: when authoring a document, and when writing a serializer. In any other situation you're working with a data model instead of an actual representation, and therefore escaping should never be necessary. If it is something smells bad in the system, and you know you'll hit trouble at some point.


So, with that said, what's the best way to deal with the situation?
Relying on L::C::Format->format to return the symbol seems unpredictable at best since it it unaway of of the XSPs target encoding. At the same time, FMT_HTML is predictable, but has the escaping problem.

-=Chris



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to