character encoding in linux systems

3

3

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

Posted 2011-08-11T09:02:55.850

Reputation: 143

Same question, same author: http://askubuntu.com/questions/56668/character-encoding-in-ubuntu

– N.N. – 2011-08-11T09:26:19.113

Answers

2

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).

RedGrittyBrick

Posted 2011-08-11T09:02:55.850

Reputation: 70 632

thanks it works in fedora. when I open the file from ftp remote serve. chars are in correct shape. – edib – 2011-08-11T13:20:31.307

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

$

hlovdal

Posted 2011-08-11T09:02:55.850

Reputation: 2 760