Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an .sh script and an iconv command inside. I can't use the PHP iconv function. I don't knwo why but with my script the iconv command doesn't do anything.

It's creating an empty file without my original content.

iconv -f ascii -t utf-16 "list_temp.txt" > "list.txt"

list_temptxt is encoded in ASCII and contains some content. After the execution list.txt is empty. If I execute my shell script through the terminal there're no problems ...

Anyone ?

share|improve this question

migrated from Mar 13 '13 at 6:08

This question came from our site for professional and enthusiast programmers.

You may need to adjust your paths, the path in which php executes may not be where the file exists. – datasage Mar 12 '13 at 18:43
Check your permissions on the file. – Jay Bhatt Mar 12 '13 at 18:59
But the file list.txt is created by calling the iconv cmd ... – Pierre Mar 13 '13 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.