I'm the author of XML::MyXML, a module that parses & produces XML
documents, and I have a dilemma:
Should the module produce XML documents as byte strings, or as character
strings (i.e. with perl's internal format)?
The same question applies to parsing: should the XML documents that the
module parses be byte strings or character strings?
I'm examining use cases, to weigh the pro & cons of each option:
1) Mojolicious and other web frameworks expect strings passed to the
browser to be character strings
2) AnyEvent network server sends byte strings to its users
3) The JSON module, if it serves as an example, lets you choose whether
to encode or not, but its encode_json function produces byte strings.
Do you have any other use cases? Do you have a preference? What do you
think I should do?
The module's current behaviour is to produce byte strings, but one
person I know said he prefers character strings.
I guess I should place an option to let the user choose, but should I
change the default to character strings?
What are your opinions?
Thanks,