Question

I have a Turkish written text but I have some strange characters for example: ý instead of ı, Ý instead of İ etc... I tried to convert encoding to iso 8859-9 but it didn't help.

Was it helpful?

Solution

If you're running a UNIX/Linux machine, try the following shell command:

you@somewhere:~$ file --mime yourfile.txt

It should output something like the snippet below, where iso-8859-1 is the acutal character set your system assumes:

yourfile.txt: text/plain; charset=iso-8859-1

Now you can convert the file into some more flexible charset, like UTF-8:

you@somewhere:~$ iconv -f iso-8859-1 -t utf-8 yourfile.txt > converted.txt

The above snippet specifies both, the charset to convert -from (which should equal the output of the file command) as well as the charset to convert -to. The result of the conversion of yourfile.txt is then stored in converted.txt, which you should be able to open with gedit.

If that doesn't work, you may paste the output of the file command, as well as some real line of your file, in the comment section...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top