What is UTF-8?
UTF-8 (Unicode Transformation Format) is an 8-bit Unicode conversion format. It is used to encode Unicode characters in groups of 8-bit variable byte numbers. Character encoding is a way of telling a computer how to interpret raw zeros and ones into real characters. When we write text to a file, the words and sentences we create are made up of different characters, and the characters are arranged in a character set. Or the codes written in a programming language are converted into this format by the system and presented to the user.
For example, in the Mousepad application, UTF-8 is defined as the default encoding:

If you are working on Linux operating system, you should use these converters. If you have received a warning/error regarding UTF-8, read this post. In this article, we will explain the steps to enable UTF-8 on Linux operating systems.
Let's enable UTF-8 for systems based on major distributions that are used by most users on Linux.
How to enable UTF-8 Redhat Based OS
The following steps can be applied in linux distributions based on Redhat operating system such as Centos, Rocky Linux, AlmaLinux, Fedora, etc.
Step-1: Show current UTF-8 settings
First view the settings current in the system:
[foc@rocky9 ~]$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
...
or
[foc@rocky9 ~]$ localectl
System Locale: LANG=en_GB.UTF-8
VC Keymap: us
X11 Layout: us
The language you used and the UTF format are also displayed.
Step-2: Show the list of available locales
Use the following command to list available languages and UTF formats:
[foc@rocky9 ~]$ localectl list-locales
...
en_SC.UTF-8
en_SG.UTF-8
en_US.UTF-8
...
After this command, you will see a long list.
Step-3: Change UTF-8 setting
To change the UTF settings, you can do it by giving the set-locale and LANG parameters to the localectl command. For example:
[foc@rocky9 ~]$ sudo localectl set-locale LANG=en_US.UTF-8
or you can manually edit the /etc/locale.conf file:
[foc@rocky9 ~]$ sudo vi /etc/locale.conf
Change en_GB.UTF-8 to en_US.UTF-8. Then check system locale settings:
[foc@rocky9 ~]$ cat /etc/locale.conf
LANG=en_GB.UTF-8
How to enable UTF-8 Debian Based OS
In this step, let's explain how to make UFT settings in distributions such as Debian based systems, Pardus, Ubuntu, Mint.
Step-1: Show current UTF-8 settings
You can view the UTF settings with the locale command:
foc@ubuntu22:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
...
Step-2: Show the list of available locales
Reconfigure the locales package to show the list of available locales:
foc@ubuntu22:~$ sudo dpkg-reconfigure locales

Step-3: Change UTF-8 setting
Run the locales package with root user or sudo:

Select UTF and language from the list. Determine which of the selected settings will be default:

Press OK:
foc@ubuntu22:~$ sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
en_GB.UTF-8... done
en_US.UTF-8... done
tr_TR.UTF-8... done
Generation complete.
The settings have been applied successfully.
References
unix.stackexchange.com - How can I enable UTF-8 support in the Linux console?

![How to enable UTF-8 in Linux? [SOLVED]](/enable-utf-8-linux/enable-utf-8-linux-800w.webp)

![Convert Decimal to Fraction [7 Programming Languages]](/convert-decimal-to-fraction/convert-decimal-to-fraction_hu_947618e63f2bcbeb.webp)
![Where to set environment variables in Linux? [SOLVED]](/where-to-set-environment-variables-in-linux/set-env-variable_hu_878a57923c42afb8.webp)
![Exclude Users from Match Group in SSHD [SOLVED]](/exclude-users-from-match-group-sshd/exclude-users-matchgroup_hu_60d8fc7c4f68c7f5.webp)
![Add User to Group in Linux Efficiently [5 Methods]](/add-user-to-group-in-linux/add-user-to-group-linux_hu_c42f8254ff8ea14f.webp)
![How to PROPERLY delay reboot in Linux? [5 Methods]](/delay-reboot-in-linux/delay-reboot_hu_72714dbb333ab303.webp)
![Linux File Descriptors [In-Depth Tutorial]](/linux-file-descriptors/file-descriptors-1_hu_665cd0f292f2ecd.webp)
![How to Edit a File in Linux? [SOLVED]](/linux-how-to-edit-a-file/linux-edit-file_hu_56790211bb4240e6.webp)
![How to ignore certificate check in wget? [SOLVED]](/wget-ignore-certificate-error/wget-ignore-cert-check_hu_642b675c53189fd2.webp)