Asymmetrical encode/decodeURI

The forum for designers and developers.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
SilverEagle
Posts: 713
Joined: 30. Sep 08, 14:00
Location: Netherlands
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Asymmetrical encode/decodeURI

Postby SilverEagle » 9. Apr 09, 10:56

Hi Team,

I have a CD called "Die größten Erfolge".

When I put this in encodeURI() it results in "Die%20gr%C3%A6%C3%8Ften%20Erfolge". But when I put this back in decodeURI() it does not result in the original string:

encodeURI.JPG
encodeURI.JPG (9.63 KiB) Viewed 1885 times


I attached this console output as I could not copy it and did not know how to type in the result :-)

Note that online converters on the internet give "Die+gr%C3%B6%C3%9Ften+Erfolge" as a result for encoding (UTF-8 based), when I feed this into decodeURI() I get the correct original string.

Bug, feature, my misunderstanding?

SilverEagle

User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Asymmetrical encode/decodeURI

Postby Service-Team » 9. Apr 09, 12:09

Hello SilverEagle,

thank you for your hints. We will check this issue. Probably, this is a bug, not a feature ;-)

Best regards,
Your Silverjuke-Team

User avatar
Service-Team
Posts: 2448
Joined: 7. Dec 04, 04:48
Location: Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Asymmetrical encode/decodeURI

Postby Service-Team » 9. Apr 09, 22:20

Hello again,

we found the error; it is a bug in encodeURI() in combination with some Unicode-Characters. The bug will be fixed with the next update.

Best regards - and thanks again -
Your Silverjuke-Team


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Developer Network”