FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How do I force PHP to assume UTF-8 for $_GET?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How do I force PHP to assume UTF-8 for $_GET? [message #174541 is a reply to message #174424] Fri, 17 June 2011 07:27 Go to previous message
Martin Kotulla is currently offline  Martin Kotulla
Messages: 4
Registered: June 2011
Karma:
Junior Member
On 11.06.2011 01:20, Jerry Stuckle wrote:
>
> Get whomever wrote the Windows application to fix it. If it is sending
> UTF-8 characters, it must indicate so.
>
> It may not even be PHP's fault - the characters may be filtered out by
> the server. It's the old story - GIGO - and you have garbage going in.
>

Jerry, Richard:

Actually, it's another old story: Hunting purported bugs in the wrong
place hinders fixing the real bugs... :-)

My assumption that PHP was seeing only two bytes instead of three was
wrong. I wrote the string to a log file and looked at it with 'tail'. It
was 'tail' that dropped the out-of-range character 0x95, not PHP. When I
wrote strlen($name) to the log file, the value turned out to be 3.

The real bug was in a completely different place: The PHP script called
a Python script, and I forgot to urlencode the parameters. Now that this
is done, the script combo works fine.

Thank you to both of you!

Best,

-mk
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ldap_modify
Next Topic: Displaying UTF-8-encoded strings from MySQL with PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 18:43:55 GMT 2024

Total time taken to generate the page: 0.04691 seconds