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 #174420 is a reply to message #174418] Fri, 10 June 2011 20:56 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <95f7trFehmU1(at)mid(dot)individual(dot)net>,
Martin Kotulla <mk999(at)gmx(dot)de> wrote:

> On 10.06.2011 20:54, Tim Streater wrote:
>>
>> How do you know it's dropped anything? IIRC PHP knows nothing about
>> character sets, just bytes. Have you tried something like the following:
>>
>> $mystr = $_GET["mystr"];
>> $utfstr = iconv ("iso-8859-1", "UTF-8//IGNORE", $mystr);

> I tried that before. But in the example that I gave, the three UTF-8
> bytes came out as two ISO-8859-1 characters. The 0x95 was dropped,
> presumably because it's in the range 0x80 to 0x9F which is not defined
> in ISO-8859-1.

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?

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[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: Fri Sep 20 13:15:24 GMT 2024

Total time taken to generate the page: 0.04479 seconds