The syntax for using iconv is as follows: $ iconv option You can check the encoding of a file using the file command, by using the -i or -mime flag which enables printing of mime type string as in the examples below: $ file -i Car.java In Linux, the iconv command line tool is used to convert text from one form of encoding to another. There are various encoding schemes out there such as ASCII, ANSI, Unicode among others. When we type text in a file, the words and sentences we form are cooked-up from different characters, and characters are organized into a charset. In simple terms, character encoding is a way of informing a computer how to interpret raw zeroes and ones into actual characters, where a character is represented by set of numbers. Every other thing such as letters, numbers, images must be represented in bits for a computer to process. A bit has only two possible values, that is either a 0 or 1, true or false, yes or no. Then finally, we will look at how to convert several files from any character set ( charset) to UTF-8 encoding in Linux.Īs you may probably have in mind already, a computer does not understand or store letters, numbers or anything else that we as humans can perceive except bits. In this guide, we will describe what character encoding and cover a few examples of converting files from one character encoding to another using a command line tool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |