I sometimes need to open text files that are encoded in EUC-KR.

man gedit gives:

          Set the character encoding to be  used  for  opening  the  files
          listed on the command line.

This can be used to open specific files with the desired encoding:

gedit --encoding euc-kr readme.txt

However, each file to be opened requires a similar command to be typed.

I can run iconv on the file(s), but then I have to deal with different file versions.

Do I have better options for dealing with non-utf8 text files?


The easiest way to specify the encoding when opening the file is to use the Open Files dialog.

On the bottom left, you will see an drop-dwon option for Character encoding. If you haven't used the encoding in Gedit before, scroll down to Add or Remove....

In the new dialog, scroll down the list of Available Encodings until you find the one you want, then click Add to send it to the list of encodings on the right, then OK.

That's it. After that you easily open the file with the correct encoding.

enter image description here

  • 2
    That's exactly what I was looking for. I kept looking for it in the File, Edit, Tools, and View menu... – user85023 Apr 18 '13 at 6:22

Nautilus Action

To have access to custom open options for Gedit from the file browser Nautilus we may define a Nautilus Action to have an entry in the right mouse click context menu which opens a selected file in Gedit with certain options. The command line for your action would then be:

/usr/bin/gedit --encoding euc-kr %b

By doing so you will be able to open files with euc-kr encoding on selecting your custom context menu entry but still be able to just double click open other files having a standard encoding.

Custom .desktop file

To be able to select Korean encoding as option in the open with dialog or as standard option we may create a custom kr-gedit.desktop file (e.g. located in ~/.local/share/applications) to include options in the Exec= line. Add this custom "application" to the files properties dialog (on right click on a .txt file).


For the command line you may define an alias to open files with a Korean encoding. This can also be made permanent:

alias kr-gedit="gedit --encoding euc-kr"

Add auto detected charset in file: ~/.gconf/apps/gedit-2/preferences/encodings/%gconf.xml

<?xml version="1.0"?>
    <entry name="auto_detected" mtime="1444988803" type="list" ltype="string">
        <li type="string">
    <entry name="shown_in_menu" mtime="1444988803" type="list" ltype="string">
        <li type="string">

Here the line "<stringvalue>***</stringvalue>" - the desired cahrsets

  • How does this help the OP? – TheWanderer Oct 19 '15 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy