HTML form coding problem

Bill Campbell linux-sxs
Sun Oct 9 19:55:47 PDT 2005


On Sun, Oct 09, 2005, David A. Bandel wrote:
>Regurgitating the prose of Bill Campbell Bill Campbell
><linux-sxs at celestial.com> on Sun, 9 Oct 2005 17:23:21 -0700: begin  
>
...
>|I think you're running into an HTML standard in which is encodes
>|many ``non-standard'' ASCII characters to their hex equivalent.
>
>exactly.  The # is reserved.  Nevertheless, I need it to go into the
>URL bar unchanged.

You got me there.  I doubt that there is any way to do that, much
less one that wouldn't be browser specific.

>|
>|What tools are you using to process the form?  I think most of
>|the standard perl/python/php tools have the ability to map these
>|back to ascii.
>
>Perl is doing the form processing, or at least, it's coded in Perl.
>Code is here: http://www.pananix.com/calcs.txt

It's been at least ten years since I handled CGI stuff manually.
How does the text come into your script (e.g. are you seeing a
``#'' character or the ``%23'' hex?

If it's hex, I think you can convert this with something like:

	($fixedval = $rawval) =~ s/%([0-9a-f]{2})/hex(\1)/gio;

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Systems, Inc.
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

``It is surprising how much new stuff users find that developers never do.
You put a copy in front of a normal user and they find all these bugs that
you would think developers would find. The real users and developers are
completely different species as far as I am concerned.''
    --Linux creator Linus Torvalds


More information about the Linux-users mailing list