How can I copy the contents of a file into another file without using cp?
I have an XML file that I need to parse with `Lex` but it is not working since it is encoded in UTF-8. However if I open the file copy the contents into an empty file and save it, `Lex` reads it. I tried making `Lex` read UTF-8 but it doesn't work. I also tried converting the file with `iconv` but it doesn't do it, a byte diff comparison says the converted and the original are the same. `cp` doesn't work since it copies the encoding, do you have any ideas how I can perform the operation above on the command line or in c (without reading and rewrirting the whole file, which I haven't tried yet). 
How can I copy the contents of a file into another file without using cp?
===

I have an XML file that I need to parse with `Lex` but it is not working since it is encoded in UTF-8. However if I open the file copy the contents into an empty file and save it, `Lex` reads it. I tried making `Lex` read UTF-8 but it doesn't work. I also tried converting the file with `iconv` but it doesn't do it, a byte diff comparison says the converted and the original are the same. `cp` doesn't work since it copies the encoding, do you have any ideas how I can perform the operation above on the command line or in c (without reading and rewrirting the whole file, which I haven't tried yet). 