Re: "Wide character in syswrite" in writing an HTML form.
- From: benkasminbullock@xxxxxxxxx
- Date: 14 May 2006 09:11:57 -0700
Alan J. Flavell wrote:
On Sun, 14 May 2006, Ben Bullock wrote:
I have written a Perl script which accesses a WWW form, gets the
text, does some editing and then sends it back. I'm encountering a
problem. I'm using the latest version of Perl, 5.8.8, with the
libwww and HTML::Form modules. I keep getting the above error
message "Wide character in syswrite" when my code tries to update
the page. It is in UTF8.
I don't know the answer, but it's an area that's of interest to me...
When you know the answer, maybe you'd be in a position to update this
bug: http://rt.cpan.org/Ticket/Display.html?id=17249 - SCNR. I found
that with a simple google - odd that you didn't mention it yourself.
I found that one, it looks similar to my situation. I don't know why
you think that it's odd that I didn't mention it though - I found
buckets of hits on Google for similar-looking things, and I don't know
which one is relevant.
I hadn't seen it before, so I can't really say what it implies yet.
Just how close would you say that report is to your own problem?
Also, I have had some characters mangled.
Sorry, but this is not a useful report!
Hmm? Some non-ascii UTF8 characters got mangled into non-UTF8
compliant characters going out from my program back to the WWW form.
To get a worthwhile result, you need to boil the problem down into a
simple test case that we can reproduce for ourselves. Web forms
submission is particularly fraught with pitfalls and hurdles. Just
saying the equivalent of "it doesn't work" gets us no further.
I don't have a complete test program I can show you here,
unfortunately. I've tracked the bug to the following lines in my code:
use LWP::UserAgent;
use HTML::Form;
sub replace_text_in_form
{
my $ua = $_[0]; # user agent
my $form = $_[1]; # already-parsed form from HTML::Form
my $newtext = $_[2]; # update the textbox with this new text
$form->value ("textbox", $newtext);
my $request = $form->click;
my $response = $ua->request($request);
return $response;
}
Sometimes I get a value in "$response->status_line" of "500 Wide
character in syswrite" error and it fails, and sometimes it works, but
either time some of the non-ascii characters get mangled. I checked
and the characters are mangled after they go out: they are OK going in
to the above.
have tried extensive searches of Google about how to solve this
problem, with no luck so far.
Be explicit! Otherwise, people trying to help you are just going to
repeat the things you already found.
Yeah, well, people often say things like that on Usenet, but then you
give them more details to work on, and after all that you often find
they don't know the answer anyway :-). Have a nice day.
.
- Follow-Ups:
- Re: "Wide character in syswrite" in writing an HTML form.
- From: John Bokma
- Re: "Wide character in syswrite" in writing an HTML form.
- From: Peter J. Holzer
- Re: "Wide character in syswrite" in writing an HTML form.
- References:
- "Wide character in syswrite" in writing an HTML form.
- From: Ben Bullock
- Re: "Wide character in syswrite" in writing an HTML form.
- From: Alan J. Flavell
- "Wide character in syswrite" in writing an HTML form.
- Prev by Date: Re: "Wide character in syswrite" in writing an HTML form.
- Next by Date: Re: Q: How to improve CGI performance for this?
- Previous by thread: Re: "Wide character in syswrite" in writing an HTML form.
- Next by thread: Re: "Wide character in syswrite" in writing an HTML form.
- Index(es):