Re: [code] [textadept] Add encoding

From: Mitchell <>
Date: Wed, 28 Aug 2013 08:48:35 -0400 (Eastern Daylight Time)


On Wed, 28 Aug 2013, A.M. Genaev wrote:

> Hi Robert,
> Thanks for explanation.
> Now i can convert UTF-8 text into KOI8-R and save file (indeed in KOI8-R).
> But I'm more intresting in reverse task. I have many old files in KOI8-R and
> want to edit their. When textadept opens such file it sets ISO-8859-1 encoding
> and conversion into KOI8-R fails.
> For example attached files contain russian word 'тест' (test) but when i open
> test_KOI8-R i see ÔÅÓÔ and it is true for ISO-8859-1. It is clear that
> textadept can't understand that i want KOI8-R but may be there is any way to
> set KOI8-R (or other two bytes encoding) as default? And why don't work
> conversion between two bytes encodings (really ÔÅÓÔ in ISO-8859-1 is тест in
> KOI8-R)?

Instead of

   io.encodings[#io.encodings + 1] = 'KOI8-R'

do this:

   table.insert(io.encodings, 3, 'KOI8-R')

That will try your encoding before ISO-8859-1. Hopefully you'll get a
positive match there.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 28 Aug 2013 - 08:48:35 EDT

This archive was generated by hypermail 2.2.0 : Thu 29 Aug 2013 - 06:33:26 EDT