@adelia
To convert a file format to UTF-8 in Linux, you can use the iconv
command. Here's the syntax:
1
|
iconv -f <source_format> -t UTF-8 <input_file> -o <output_file> |
Where:
So, to convert a file named input.txt
from the ISO-8859-1 format to UTF-8, you would use the following command:
1
|
iconv -f ISO-8859-1 -t UTF-8 input.txt -o output.txt |
This command will read the content of input.txt
, convert it to UTF-8, and save the converted content in output.txt
.
@adelia
To convert a file format to UTF-8 in Linux, you can use the recode
command. Here's how you can do it:
1
|
sudo apt-get install recode |
1
|
recode <original_encoding>..UTF-8 <input_file> |
For example, if you have a file named example.txt
encoded in ISO-8859-1 and you want to convert it to UTF-8, you can run the following command:
1
|
recode ISO-8859-1..UTF-8 example.txt |
This command will convert the example.txt
file from ISO-8859-1 to UTF-8 encoding. You can also redirect the output to a new file if needed:
1
|
recode ISO-8859-1..UTF-8 example.txt > output.txt |
This will save the converted content to a new file named output.txt
.