Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting encoding from unknown-8bit to us-ascii not supported

I am trying to convert from unknown-8bit to us-ascii by using iconv. I have $ iconv -f unknown-8bit -t us-ascii file.txt > file1.txt

It shows an error message.

iconv: conversion from `unknown-8bit' is not supported
Try `iconv --help' or `iconv --usage' for more information.

Is there an alternative to conduct the conversion? Thank you!!

like image 943
yearntolearn Avatar asked Jul 08 '16 21:07

yearntolearn


1 Answers

You could use cat -v, e.g.,

cat -v file.txt > file1.txt

On most platforms, that will give an ASCII file.

like image 87
Thomas Dickey Avatar answered Sep 18 '22 06:09

Thomas Dickey