character encoding in linux systems

31,803

Solution 1

Have you tried setting your locale to tr_TR.ISO-8859-9

To find out what your current locale is, use the locale command with no arguments. It will print the values of all of the relevant environment variables except for LANGUAGE. locale charmap prints the name of the current encoding. To find out what locales are available, type locale -a. To find out what encodings are available, type locale -m.

If you use gedit's file-open dialogue you can choose an appropriate encoding for the file you are opening.

If the above doesn't help, please update your question with the output of file filename and ten relevant lines of output of hexdump -C filename

what can I do to avoid this kind of stupid things?

Use utf-8 for everything everywhere at all times. Convert anything that isn't utf-8 into utf-8 using iconv or recode. Make sure all the fonts you use support the scripts you use (i.e. have glyphs for the relevant unicode ranges).

Solution 2

You can convert with iconv:

$ iconv -f iso-8859-1 -t utf-8 somefile.latin1 > somefile.utf8

$

An alternative to iconv is to recode. If not already known, you can find out the charset with the file command:

$ file somefile.latin1
somefile.latin1: ISO-8859 text

$
Share:
31,803

Related videos on Youtube

edib
Author by

edib

Updated on September 18, 2022

Comments

  • edib
    edib over 1 year

    I have web page its charset is 8859-9 and it was prepared in windows with char encoding ascii. from ftp access, I am opening it via gedit in ubuntu then turkish chars changes like (turkish ı became ý). what can I do to avoid this kind of stupid things?

  • edib
    edib almost 13 years
    thanks it works in fedora. when I open the file from ftp remote serve. chars are in correct shape.