Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] utf form problems



Hello

On 26/02/2008, steven smith <sjs@example.com> wrot
>  I'm using perl 5.8.8 and have a script for debugging.  I'm
>  trying to use HTML::Entities to decode the input.

Why?  Where are the entities?  There were none in your example, and it
is highly unlikely that a user would enter them in a way you could
depend on.

>  I'm pretty sure the form is the problem.

I'm pretty sure the problem is how you are getting the value for
$input.  Please post that bit of code.

> It looks like the  encoded string being sent to the server is wrong.

No, the encoded string is correct.


>  I have debug statements to look at what is arriving on stdin

You're reading stdin directly!?  Don't do that.

>  and the debug output in the browser looks like:
>     $input = "rtk_kanji_1=%E5%8A%A9"
>     $output = "rtk_kanji_1=%E5%8A%A9"

  $ perl -MURI::Escape -wle 'print uri_unescape "%E5%8A%A9";'
  助

>  so decode_entities isn't doing anything with the string
... because the string doesn't contain any entities.

>  to me the encoded string doesn't look like what I expected
>  for an encoded utf-8 string.

Adjust your expectations. :-)

-- 
Marty

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links