0

I am currently facing a problem with character encoding.

In Url I got the name of image like "Meppen_Hafenstraße_test.jpg". In my server this image is also saved as "Meppen_Hafenstraße_test.jpg". so when i call Unlink() in my controller to remove the image from server it gives me an error.

A PHP Error was encountered

Severity: Warning

Message: unlink(immobilien-boeker.de/assets/images/gallery/Meppen_Hafenstra%C3%9Fe_test.jpg) [function.unlink]: No such file or directory

Filename: controllers/Boeker.php

so "ß" actually converted to "%C3%9F" . I have no idea how to stop this encoding ? Please help.

Community
  • 1
  • 1
jahirS
  • 33
  • 3
  • 1
    Possible duplicate of [php unlink() non-ascii characters = file not found](http://stackoverflow.com/questions/25537833/php-unlink-non-ascii-characters-file-not-found) – Franz Gleichmann Jul 14 '16 at 09:02

1 Answers1

0

the string is URL encoded. You need to decode it, to get the ehmmm decoded version :)

\n"; $decoded = urldecode($test); echo "Encoded" .$decoded."
\n"; ?>

See http://php.net/urldecode and http://php.net/urlencode

Hope I could help.

MrMagix
  • 116
  • 1
  • 4