Well, the script I wrote was a hack job to show what I was doing.
Technically, the data is being based through _POST. Are you saying the only
way to get this to work is to Unicode the scripts on the file system? I
never herd of that requirement.
I'm trying to make a form submit function more unicode friendly. I have the
required UTF-8 accet charset in place. I have verified that 'Bertrán' is
being passed across properly. I even verified that PHP doesn't mess with it
(by printing out _POST). However, once it goes through the filter process,
it gets stripped.
Philip
On Tue, Mar 25, 2008 at 7:20 PM, Guillaume Rossolini <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I suppose the script is encoded as Unicode in your filesystem? Your
> sample code fails if encoded as ANSI, but succeeds if encoded as UTF-8.
>
> <?php
> require_once 'Zend/Filter/Input.php';
>
> $_POST['first_nm'] = "Bertrán";
>
> $filters = array ( 'first_nm' => 'Alpha' );
> $validators = array( 'first_nm' => array ('Alpha', 'presence' =>
> 'required') );
> $input = new Zend_Filter_Input($filters, $validators, $_POST);
>
> echo $input->isValid() ? 'ok' : 'dead';
>
>
> Regards,
>
>
>
>
> On 3/25/08, Philip G <[EMAIL PROTECTED]> wrote:
> >
> >
> > I'm trying to get a form to validate with unicode characters.
> >
> > For a very simple example, I have:
> >
> > $_POST['first_nm'] = "Bertrán";
> >
> > $filters = array ( 'first_nm' => 'Alpha' );
> > $validators = array( 'first_nm' => array ('Alpha', 'presence' =>
> > 'required) );
> > $input = Zend_Filter_Input($filter, $validators, $_POST);
> >
> >
> > Now, a simple $input->isValid() call and it fails. Returns: [first_nm]
> > => Array ( [stringEmpty] => ' ' is an empty string )
> >
> > Is there something special I need to do in order to get
> > Zend_Filter_Input to understand UTF-8? I've checked the data being passed to
> > PHP; it is valid. I checked the code and it seems to do some utf8 check, but
> > apparently it's not working for some reason.
> >
> > Thanks
> >
> > --
> > Philip
> > [EMAIL PROTECTED]
> > http://www.gpcentre.net/
>
>
>
>
> --
> Guillaume Rossolini
--
Philip
[EMAIL PROTECTED]
http://www.gpcentre.net/