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?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Martin Kotulla <mk999@gmx.de>
Newsgroups comp.lang.php
Subject Re: How do I force PHP to assume UTF-8 for $_GET?
Date Fri, 17 Jun 2011 09:27:48 +0200
Lines 28
Message-ID <960e0nFjiaU1@mid.individual.net> (permalink)
References <95f6abF3qjU1@mid.individual.net> <isu8sl$oei$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net KGPDBxVILvnlN0x3VU9SJwSFENI+0uXlzmxBgdjwrL3+WqgLU=
Cancel-Lock sha1:q/PKv912aWLzLLCvPz/+2cQF2lg=
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10
In-Reply-To <isu8sl$oei$1@dont-email.me>
Xref x330-a1.tempe.blueboxinc.net comp.lang.php:2212

Show key headers only | 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