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



Expected glyph in cp932.txt are following.


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

But message of the converting encoding fail is shown.



I used attached txt files for the tests.


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