How to convert a UTF-8 file to ASCII file and retain special characters?

I have a UTF-8 file that contains English and Spanish text. The Spanish text uses characters like a tilde. Additionally, the text contains copyright and trademark symbols.

I need to convert the file to ASCII format to use import into a new application. I tried converting the file in Linux like this but the resulting file is striped off all special characters:

iconv --from-code UTF-8 --to-code US-ASCII -c originalfile.txt > newfile.txt

I can also convert the file in the PHP application before generating (if easier).

Any ideas?
bearclaws75Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
You need to use another format.  ASCII is just the 7-bit characters.  ISO-8859-1 might be the first choice but ANSI is also known as Windows-1252 character set.  http://www.alanwood.net/demos/charsetdiffs.html
0
 
Dave BaldwinFixer of ProblemsCommented:
US-ASCII simply doesn't have those characters.  http://en.wikipedia.org/wiki/ASCII
0
 
bearclaws75Author Commented:
I can live without the Spanish text but what about the copyright and trademark symbols; however, I don't see those listed in the ASCII charts either:
http://en.wikipedia.org/wiki/File:ASCII_Code_Chart.svg

Is there any ASCII format that can handle these characters or do I need to use another character format?
0
 
bearclaws75Author Commented:
Thanks! This is very helpful.
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  Thanks for the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.