Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

iconv(1) [opendarwin man page]

ICONV(1)						     Linux Programmer's Manual							  ICONV(1)

iconv - character set conversion SYNOPSIS
iconv [-c] [-s] [-f encoding] [-t encoding] [inputfile ...] iconv -l DESCRIPTION
The iconv program converts text from one encoding to another encoding. More precisely, it converts from the encoding given for the -f option to the encoding given for the -t option. Either of these encodings defaults to the encoding of the current locale. All the input- files are read and converted in turn; if no inputfile is given, the standard input is used. The converted text is printed to standard out- put. When option -c is given, characters that cannot be converted are silently discarded, instead of leading to a conversion error. When option -s is given, error messages about invalid or unconvertible characters are omitted, but the actual converted text is unaffected. The encodings permitted are system dependent. For the libiconv implementation, they are listed in the iconv_open(3) manual page. The iconv -l command lists the names of the supported encodings, in a system dependent format. For the libiconv implementation, the names are printed in upper case, separated by whitespace, and alias names of an encoding are listed on the same line as the encoding itself. SEE ALSO
iconv_open(3) GNU
January 13, 2002 ICONV(1)

Check Out this Related Man Page

ICONV(1)							 Debian GNU/Linux							  ICONV(1)

iconv - Convert encoding of given files from one encoding to another SYNOPSIS
iconv -f encoding [-t encoding] [inputfile]... DESCRIPTION
The iconv program converts the encoding of characters in inputfile, or from the standard input if no filename is specified, from one coded character set to another. The result is written to standard output unless otherwise specified by the --output option. --from-code, -f encoding Convert characters from encoding. --to-code, -t encoding Convert characters to encoding. If not specified the encoding corresponding to the current locale is used. --list, -l List known coded character sets. -c Omit invalid characters from output. --output, -o file Specify output file (instead of stdout). --silent, -s Suppress warnings, but not errors. --verbose Print progress information. --help, -? Give help list. --usage Give a short usage message. --version, -V Print program version. ENCODINGS
The values permitted for --from-code and --to-code can be listed by the iconv --list command, and all combinations of the listed values are supported. Furthermore the following two suffixes are supported: //TRANSLIT When the string "//TRANSLIT" is appended to --to-code, transliteration is activated. This means that when a character cannot be represented in the target character set, it can be approximated through one or several similarly looking characters. //IGNORE When the string "//IGNORE" is appended to --to-code, characters that cannot be represented in the target character set will be silently discarded. AUTHOR
iconv was written by Ulrich Drepper as part of the GNU C Library. This man page was written by Joel Klecker <>, for the Debian GNU/Linux system. 3rd Berkeley Distribution lenny ICONV(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl question - removing line from input file

In perl I want to do remove the top line of my input file then process the next line. I want to do something like head -1 inputfile > temp grep -v temp inputfile > newinputfile cp newinputfile inputfle is this possible in perl? (3 Replies)
Discussion started by: reggiej
3 Replies

2. Programming

about iconv

I want to use iconv.h to convert some text to another charset. The code is below: #include <stdio.h> #include <stdlib.h> #include <iconv.h> int main() { iconv_t cd; char instr="汉字"; char *inbuf; char *outbuf; unsigned int insize=7; ... (4 Replies)
Discussion started by: yong
4 Replies

3. UNIX for Advanced & Expert Users

Convert UTF8 Format file to ANSI format

:) Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on this.........Let me... (1 Reply)
Discussion started by: rajreddy
1 Replies

4. Shell Programming and Scripting

No puedo borrar un renglon

#!/bin/sh # Solo para Argentina :s # License: Sisterware # este script necesita curl e iconv, iconv es porque los del servicio meteorologico no usan utf-8 # 87938 = Ushuaia # 87934 = Rio Grande # 87418 = Mendoza # 87582 = Capital Federal # 87692 = Mar del Plata # 87480 = Rosario #... (1 Reply)
Discussion started by: yamirokuay
1 Replies

5. Shell Programming and Scripting

Shell script for weather / forecast

#!/bin/sh #Argentina Only :s # This script requires curl and iconv, iconv is because they do not use Weather Service utf-8 # 87938 = Ushuaia # 87934 = Rio Grande # 87418 = Mendoza # 87582 = Capital Federal # 87692 = Mar del Plata # 87480 = Rosario # 87344 = Cordoba # 87371 = Santa Fe ... (8 Replies)
Discussion started by: yamirokuay
8 Replies

6. Shell Programming and Scripting

extra character with iconv encoding

hey, I am trying to convert a sample russian encoding file to English encoding using iconv utility. Its almost done but with each converted character i am getting one extra character which must not come. my sample Russian text is test.txt А Б В Г Д Е Ж З И Й К ~ and script which i... (4 Replies)
Discussion started by: peeyushgehlot
4 Replies

7. UNIX for Dummies Questions & Answers

Cross-compiling libiconv for uclinux

Hi everyone, I want to cross-compile libiconv for uclinux to create a static library. I use the following command : ./configure --enable-static --disable-shared --build=i686-pc-linux-gnu --host=nios2-unknown-linux-gnu --prefix=/home/captain/Programs/nios2-linux/uClinux-dist/staging/usr... (2 Replies)
Discussion started by: moganesh
2 Replies

8. Shell Programming and Scripting

Why does my test fail ??

Hello, I am stuck... i dunno why does my test fail... any idea ? #!/bin/bash dos2unix info.txt Distor=Distributeur LINE=$(cat info.txt | sed -n 1p) echo $LINE echo $Distor echo "" echo "123-$LINE-123" echo "123-$Distor-123" if ; then LINE2=$(cat info.txt | sed -n 2p) echo $Distor... (14 Replies)
Discussion started by: patx
14 Replies

9. Shell Programming and Scripting

Characterset conversion problem using iconv command

Hi Friends, I am not able to conver character set from UTF-8 to IBM-284 throwing an error "cannot open convertor" . Could you please help me how to get out of this error. Below command is working fine iconv -f ISO8859-15 -t UTF-8 fromfile.txt > tofile.txt But the below command is... (2 Replies)
Discussion started by: sivakumarl
2 Replies

10. Shell Programming and Scripting

Help with command iconv

I need to convert a utf16 file to utf8. When i use the iconv command to do so it gives an error saying invalid function. When I ran the iconv -l function it did not list the utf16 and utf8 as part of its internal table. Is there anyway I can add these encodings in the library? Is there any other... (3 Replies)
Discussion started by: gaun
3 Replies

11. Shell Programming and Scripting

Iconv for large files

Hi I am using iconv command to convert the encoding of files. Below is the command used: iconv -f UCS-2 -t UTF-8 inputfile.txt> outputfile.txt The command is working fine for files less than 2GB. When I try converting the files of more than 2GB size I get an error as 'Can't open file'. I... (2 Replies)
Discussion started by: vrcr
2 Replies

12. UNIX for Advanced & Expert Users

Iconv on large files

Hi All, I am using iconv to convert huge files. the process is getting killed. I tried the option in below link i.e iconv -f UCS-2 -t UTF-8 < inputfile.txt > outputfile.txt However, the process still gets... (4 Replies)
Discussion started by: tostay2003
4 Replies

13. Solaris

View file encoding then change encoding.

Hi all!! Im using command file -i myfile.xml to validate XML file encoding, but it is just saying regular file . Im expecting / looking an output as UTF8 or ANSI / ASCII Is there command to display the files encoding? Thank you! (2 Replies)
Discussion started by: mrreds
2 Replies

14. UNIX for Beginners Questions & Answers

Change encoding, no removing special chars. inconv

Hi all, I'm using iconv command to change files encoding to UTF-8 If my input file has chars as those are removed creating the file without those special chars. I tried using iconv -c, but there is still the removal. Is there a way to keep those special chars changing just the... (6 Replies)
Discussion started by: mrreds
6 Replies

15. UNIX for Beginners Questions & Answers

Explain iconv command

I have a requirement to remove all non-ascii characters from a fixed length file. I used the below command which is removing special characters but somehow the total record length is being truncated to one space less. If it is a multi-byte string then many characters at the end are being truncated.... (8 Replies)
Discussion started by: eskay
8 Replies