Ubuntu – Using gedit in Ubuntu


I use gedit for files that I also need in Windows. For the files, I use the Windows-1250 code page. In the Ubuntu, I paste texts and sometimes after that I cannot save the file in the 1250 code page. I wish to continue editing such file opened with the Windows-1250 encoding, but to display it in a way that shows the characters that I need to correct (manually) to be able to save the file in the desired code page. I have seen such displaying for other files, where the "bad" character is displayed as a 4 numbers square table, but I cannot achieve such displaying intentionally. Is it possible? How?

Best Answer

You can open a text file with that encoding this way:

gedit --encoding=WINDOWS-1250 myFile.txt

If you wish gEdit to use this encoding by default you can change the way it starts in the Main Menu application (search for it with the Lens). Then go to:

Applications > Accessories > Text Editor

and click "Properties". In the "Command" text box insert the following:

gedit --encoding=WINDOWS-1250 %U

and then click "Close" and "Close" again.

Related Question