[patch] Support "accept-charset" attribute in HTML::Form

Alex Kapranoff <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
The patch is attached.

This attribute is rarely used in HTML but the interesting functionality is
encoding character bodies of generated requests into bytes according to the
specified encoding.

If you try to click() a form specified as <form method="POST"
enctype="multipart/form-data"> with some Unicode data in its fields you will
get this error:
HTTP::Message content must be bytes at blib/lib/HTTP/Request/Common.pm line
91

My patch fixes that by always encoding wide characters to the encoding
specified in "accept-charset" attribute or set via method. Defaults to
utf-8. Avoids unneeded encodings.

Also, caution taken not to break compatibility with older perls.

Docs and tests included.
accept-diff (application/octet-stream, 4.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.