[code] [textadept] Could you please give me advice to configure encoding menu correctly?

From: Outlook Yuki <X1353135.att.outlook.com>
Date: Sat, 22 Jul 2017 16:19:42 +0000

Hi, I'm Yuki


I'm trying to add CP932 and CP936 in encoding menu, but I can not correctly load files of these encoding by using the menus.
Could you please give me advice to configure encoding menu correctly?

I configured textadept like following.


  1. ~\.textadept\init.lua
Added encoding to io.encodings table

table.insert(io.encodings, 3, 'CP932')
table.insert(io.encodings, 3, 'CP936')
ui.set_theme('light', {font = 'Monospace', fontsize = 10})

  2. ~\.textadept\modules\textadept\menu.lua
Added items under Encding menu

{
  title = _L['E_ncoding'],
  {_L['_UTF-8 Encoding'], function() set_encoding('UTF-8') end},
  {_L['_ASCII Encoding'], function() set_encoding('ASCII') end},
  {_L['_ISO-8859-1 Encoding'], function() set_encoding('ISO-8859-1') end},
  {_L['UTF-1_6 Encoding'], function() set_encoding('UTF-16LE') end},
  {_L['CP932 Encoding'], function() set_encoding('CP932') end},
  {_L['Shift_JIS Encoding'], function() set_encoding('Shift_JIS') end},
  {_L['CP936 Encoding'], function() set_encoding('CP936') end},
  {_L['GB2312 Encoding'], function() set_encoding('GB2312') end}
},



As a result, I can open cp936 file without gabled characters, but get gabled characters in cp932 file.


[cid:fd3d13b5-9b38-4d24-bc6a-73583513af82]


[cid:0fe39409-0032-4568-9037-1b94cb0bfde8]


Expected glyph in cp932.txt are following.


[cid:292a4554-7c39-4e91-996f-016662797e4f]


I tried to convert character encoding by using the menu which I added.

But message of the converting encoding fail is shown.


[cid:57fcb28e-b96f-49fd-b953-6ea05088e927]


[cid:f2d8a8c0-52b6-4287-9cbc-762085852bbb]


I used attached txt files for the tests.


Yuki

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
ta_cp936_ok1.png
ta_cp932_fail1.png
ta_cp932_fail2.png
ta_cp932_fail3.png
cp932_exp1.png
Received on Sat 22 Jul 2017 - 12:19:42 EDT

This archive was generated by hypermail 2.2.0 : Sun 23 Jul 2017 - 06:41:48 EDT