Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2212

Re: How do I force PHP to assume UTF-8 for $_GET?

From Martin Kotulla <mk999@gmx.de>
Newsgroups comp.lang.php
Subject Re: How do I force PHP to assume UTF-8 for $_GET?
Date 2011-06-17 09:27 +0200
Message-ID <960e0nFjiaU1@mid.individual.net> (permalink)
References <95f6abF3qjU1@mid.individual.net> <isu8sl$oei$1@dont-email.me>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

How do I force PHP to assume UTF-8 for $_GET? Martin Kotulla <mk999@gmx.de> - 2011-06-10 20:32 +0200
  Re: How do I force PHP to assume UTF-8 for $_GET? Tim Streater <timstreater@waitrose.com> - 2011-06-10 19:54 +0100
    Re: How do I force PHP to assume UTF-8 for $_GET? Martin Kotulla <mk999@gmx.de> - 2011-06-10 21:00 +0200
      Re: How do I force PHP to assume UTF-8 for $_GET? Tim Streater <timstreater@waitrose.com> - 2011-06-10 21:56 +0100
        Re: How do I force PHP to assume UTF-8 for $_GET? Martin Kotulla <mk999@gmx.de> - 2011-06-10 23:59 +0200
          Re: How do I force PHP to assume UTF-8 for $_GET? Tim Streater <timstreater@waitrose.com> - 2011-06-10 23:28 +0100
            Re: How do I force PHP to assume UTF-8 for $_GET? legalize+jeeves@mail.xmission.com (Richard) - 2011-06-11 03:28 +0000
  Re: How do I force PHP to assume UTF-8 for $_GET? Jerry Stuckle <jstucklex@attglobal.net> - 2011-06-10 19:20 -0400
    Re: How do I force PHP to assume UTF-8 for $_GET? Martin Kotulla <mk999@gmx.de> - 2011-06-17 09:27 +0200

csiph-web