SliTaz SliTaz Forum

You are not logged in.

#1 2012-09-15 08:25:25

black dog
Member
Registered: 2011-04-09
Posts: 331

How to change the encoding of a text file in Slitaz?

There is a text file encoded koi8r. In Slitaz he displayed or dots or spaces. I'm trying to change the encoding in the editor vim:

[c]:e ++enc=koi8r[/c]

The result:

[c]????? ? ????????? koi8r.

? ????? ??? ??? ??? ??????. ??, ?? ????????? ?????????.[/c]

Error message:

[c]"Text-koi8r.txt" [readonly][noeo][NOT converted][ILLEGAL BYTE in line 1] 2L, 80C[/c]

How to change the encoding of a text file in Slitaz?

Offline

#2 2012-09-15 10:19:10

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: How to change the encoding of a text file in Slitaz?

Hi black dog,

Make sure you're installed glibc-locale package and try again. I can't use vim, it's too hard for me to learn it. Instead it I can propose you next method—using iconv:

Get usage of iconv:

[c]iconv --help[/c]

Get full list of supported character sets:

[c]iconv --list[/c]

Convert from KOI-8R to UTF-8 file mytext.txt:

[c]iconv -f KOI8R -t UTF8 mytext.txt[/c]

Offline

#3 2012-09-15 13:41:17

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: How to change the encoding of a text file in Slitaz?

Geany also allows you to pick the encoding and file type.

Offline

#4 2012-09-15 13:48:22

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to change the encoding of a text file in Slitaz?

Thank you.

It worked. Installed the glibc-locale.

Now works not only command [c]iconv[/c], bat also command conversion in programm vim.

The only thing I do not like - the size of the package glibc-locale - 4,3 MB. Iso-slitaz image is only 8.3 MB, but additional packages that must be established - very big.

Offline

#5 2012-09-15 13:53:20

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to change the encoding of a text file in Slitaz?

to Trixar_za

I slitaz-4.0-base, there is no geany.

Unfortunately, small distributions tend to grow. smile:):)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.041 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]