[ic] Code convert of Form input data

murahashi interchange-users@interchange.redhat.com
Mon Nov 19 22:26:00 2001


Two manths ago, I asked about input-filter, but I was not able to have a
solution.
Mike, Thanks for your answer at that time.
Again, I tried some cases but not yet.

> Presumably you would use an external module to convert it, in which
> case you would make a global UserTag to access it, and your code
> inside the filter would look like "$val = $Tag->your_convert_tag($val)".

I have global Usertag like sjis and it works well like this.
 [sjis]xxxx[/sjis]

But the following filter have an error in error.log.
[input-filter name=mv_searchspec]
my $val = $CGI->{mv_searchspec};
$val = $Tag->sjis($val);
return $val;
[/input-filter]


<<error.log>>
211.124.7.107 VWjQ44Cc:211.124.7.107 - [20/November/2001:11:27:40 +0900]
foundation /cgibin/foundation.cgi/search.html Safe: unpack trapped by
operation mask at /home/sites/home/interchange/lib/jcode.pl line 506.
>
>
> my $val = $CGI->{mv_searchspec};
> $val = $Tag->sjis($val);
> return $val;

What is wrong or what should I do?
Any help would be appreciated.

 S.Muruhashi


----- Original Message -----
From: <mheins@redhat.com>
To: <interchange-users@interchange.redhat.com>
Sent: Friday, September 07, 2001 8:48 PM
Subject: Re: [ic] Code convert of Form input data


> Quoting murahashi@ayayu.com (murahashi@ayayu.com):
> > We have to convert input data from form input, and insert/update
interchange
> > database.
> > Like this.
> >
> > {Form input} ---> [code conversion] ----> [interchange database]
> >                  ISO-2022-JP    ====>    euc-JP
> >
> > Code conversion means, for example, from ISO-2022-JP to euc-JP.
> >
> > For search function like below, we don't know way to convert code of
> > searchspec.
> >
> > <FORM ACTION="[area search]">
> > <INPUT TYPE=hidden NAME=mv_coordinate VALUE=1>
> > <INPUT TYPE=hidden NAME=mv_searchtype VALUE=db>
> > <INPUT TYPE=hidden NAME=mv_matchlimit VALUE=10>
> > <INPUT TYPE=hidden NAME=mv_sort_field VALUE=category>
> > <INPUT TYPE=hidden NAME=mv_search_field VALUE=inactive>
> > <INPUT TYPE=hidden NAME=mv_search_field VALUE=":*">
> > <INPUT TYPE=hidden NAME=mv_column_op VALUE=ne>
> > <INPUT TYPE=hidden NAME=mv_column_op VALUE=rm>
> > <INPUT TYPE=hidden NAME=mv_searchspec VALUE=1>
> > <INPUT MAXLENGTH=30 NAME=mv_searchspec type=text size=10>
> > <INPUT TYPE=image alt="Search Go" border="0" src="navigation/go.gif"
> > width="23" height="17">
> > </form>
> >
> > Any idea or help would be appreciated.
>
> I am afraid I don't know how to do the conversion, but assuming there
> is some code that does that, just add a filter:
>
>     [input-filter name=mv_searchspec]
>     my $val = $CGI->{mv_searchspec};
>     # code to effect the conversion goes here
>     return $val;
>     [/input-filter]
>
> If you have already defined a $Vend::Interpolate::Filter that does
> the conversion, then it is just:
>
>     [input-filter name=mv_searchspec op=your_filter][/input-filter]
>
> If mv_searchspec is *always* to be filtered, you can instead
> do in catalog.cfg:
>
> Filter mv_searchspec your_filter
>
> Presumably you would use an external module to convert it, in which
> case you would make a global UserTag to access it, and your code
> inside the filter would look like "$val = $Tag->your_convert_tag($val)".
>
> --
> Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
> phone +1.513.523.7621      <mheins@redhat.com>
>
> Research is what I'm doing when I don't know what I'm doing.
> -- Wernher Von Braun
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
>