Re: utf8_decode() not working, conflicts with urlencode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 30.08.2011 12:11, schrieb Per Jessen:
Merlin Morgenstern wrote:

Hi there,

I am having some trouble with utf8_decode(). Somehow the function
returns output=input

e.g.:
$input = '%20%C3%9Cbersetzung%20franz';
$output = utf8_decode($input);
echo $input.'<br>'.$output;

My goal is to decode the utf8, trim the input and encode with
urlencode();

This is the string which I would like to get: %C3%9Cbersetzung+franz

Trim does not work and if I place urlencode() directly on the input it
will encode the % sign to %25 and produce therfore a mixture of
encodings.

It seems to me that you're probably missing a urldecode() on $input
before you attempt to decode the utf8 chars ?



That's right, this was missing. Thank you. However, this leeds to another problem which I described in a another posting.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux