[email protected]Office hours: Mon – Fri 9:00AM – 5:00PMLinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedSeptember 15, 2023

How to use iconv command in Linux.

How To Use Iconv Command.

iconv command is used to convert some text in one encoding into another encoding. If no input file is provided then it reads from standard input. Similarly, if no output file is given then it writes to standard output. If no from-encoding or to-encoding is provided then it uses current local’s character encoding.

Syntax:

iconv [options] [-f from-encoding] [-t to-encoding] [inputfile]...

Options:

  • -f from-encoding, –from-code=from-encoding : Use from-encoding for input characters.

  • -t to-encoding, –to-code=to-encoding : Use to-encoding for output characters.

  • -l, –list : List all known character set encodings.

  • -c : Silently discard characters that cannot be converted instead of terminating when encountering such characters.

  • -o outputfile, –output=outputfile : Use outputfile for output.

  • –verbose : Print progress information on standard error when processing multiple files.

Note:

  • If the string //IGNORE is appended to to-encoding, characters that cannot be converted are discarded and an error is printed after conversion.

  • If the string //TRANSLIT is appended to to-encoding, characters that cannot be represented in the target character set, it can be approximated through one or several similar looking characters.

Examples:

To convert from UTF-8 to ASCII :

echo abc ß ? € à?ç | iconv -f UTF-8 -t ASCII//TRANSLIT

Print the list of all character set encodings :

iconv -l

Reading and writing from a file :

iconv -f UTF-8 -t ASCII//TRANSLIT -o out.txt in.txt
Keep reading
How to Implement Network Segmentation and Resource Isolation in Linux.
February 6, 2024

How to Implement Network Segmentation and Resource Isolation in Linux.

How to Implement Network Segmentation and Resource Isolation in Linux. Securing and managing networks in a Linux environment involves advanced practices like network segmentation and resource isolation. This guide explores these concepts, providing detailed instructions and examples for…

Read article
How to open or close ports in Linux.
February 6, 2024

How to open or close ports in Linux.

How to open or close ports in Linux. Effectively managing ports on your Linux system is crucial for both security and service accessibility. This comprehensive guide will provide a detailed walkthrough on opening and closing ports using the robust tools iptables and ufw. Understanding these…

Read article
How to use ypdomainname command.
January 23, 2024

How to use ypdomainname command.

How to use ypdomainname command. In the realm of Linux networking, the ypdomainname command plays a crucial role in the context of the Network Information Service (NIS). NIS, formerly known as Yellow Pages, is a distributed database service that facilitates the sharing of network configuration and…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, colocation, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Office hours: Mon – Fri 9:00AM – 5:00PM