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 #174421 is a reply to message #174420] Fri, 10 June 2011 21:59 Go to previous messageGo to previous message
Martin Kotulla is currently offline  Martin Kotulla
Messages: 4
Registered: June 2011
Karma:
Junior Member
On 10.06.2011 22:56, Tim Streater wrote:
>
> OK, maybe I was asking the wrong question. What do you mean by "access"
> in "When I now access the parameters via $_GET in my PHP script, ..."?
> Have you checked that when the Win-app sends U+3563 you get three bytes
> of data (0xE3, 0x95, 0xA3) in your PHP script? What are you then
> intending to do with those Chinese characters?
>

The Windows app sends three UTF-8 encoded characters. The PHP $_GET
array only returns two, one being dropped by PHP because it considers
out-of-range characters (in its ISO-8859-1 mind) incorrect.

My script needs to accept arbitrary UTF-8 sequences but PHP drops these
characters because it (correctly, in its ISO-8859-1 mind) thinks they
are invalid. But in the UTF-8 system, they are valid.

I need a way to tell PHP that the sequence is UTF-8 before I access it.
As soon as my script reads something that PHP considers ISO-8859-1, the
damage is done. iconv back to UTF-8 won't help me, I cannot unscramble
scrambled eggs.

-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: Tue Nov 26 09:24:30 GMT 2024

Total time taken to generate the page: 0.04031 seconds