Converting text into ASCII/ISO-8859-1
17,325
By default, iconv refuses to convert the file if it contains characters that do not exist in the target character set. Use //TRANSLIT
to “downgrade” such characters.
iconv -f utf-8 -t iso8859-1//TRANSLIT
Author by
Šimon Tóth
Backend oriented Software developer and Researcher with industry experience starting in 2004.
Updated on September 17, 2022Comments
-
Šimon Tóth over 1 year
I'm looking for some tool that can convert text, ideally from UTF-8 (but ISO-8859-2 and WINDOWS-1250 would be fine) into ASCII/ISO-8859-1?
I have seen some online transliteration tools but I need something for the command line (and iconv is refusing to convert the file).
-
Admin about 13 yearsHm,
iconv
is the command line tool for that task. Mind to share how exactly it refuses to serve you?
-
-
Šimon Tóth about 13 yearsHmm, the description says otherwise. Are you sure?
-
Stéphane Péchard about 13 years@Let_Me_Be: ok, maybe I read too quickly your question... If what you need is a not only a format conversion but a character conversion (i.e. é => e), give a try to slugify then.
-
Šimon Tóth about 13 yearsOh, that's totally awesome, thx.