I have a file in Unicode format on a windows machine. Is there any way to convert it to ASCII format on a windows machine using perl script
It’s UTF-16 BOM.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to convert unicode to ascii, you must be aware that some characters can’t be converted, because they just don’t exist in ascii.
If you can live with that, you can try this:
If you do not have autodie, just remove that line – you should then change your open/close statements with a
If you have characters that can’t be converted, you will get warnings on the console and your output file will have e.g. text like
in it.
BTW: If you don’t have a mom but know it is Big Endian (Little Endian), you can change the encoding line to
or
Hope it works under Windows as well. I can’t give it a try right now.