Re: utf8_decode() not working, conflicts with urlencode()
| From: | Per Jessen | Date: | Tue, 30 Aug 2011 10:11:50 +0000 |
| Subject: | Re: utf8_decode() not working, conflicts with urlencode() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314649@lists.php.net to get a copy of this message | ||
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 ?
--
Per Jessen, Zürich (17.9°C)