Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 1 | " Test for setting 'encoding' to something else than the terminal uses, then |
| 2 | " setting 'termencoding' to make it work. |
| 3 | |
| 4 | " This only works with "iconv". |
Christian Brabandt | 08ea2e1 | 2025-01-25 15:01:42 +0100 | [diff] [blame] | 5 | CheckFeature iconv |
Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 6 | |
| 7 | source screendump.vim |
| 8 | if !CanRunVimInTerminal() |
Bram Moolenaar | 5d30ff1 | 2019-06-06 16:12:12 +0200 | [diff] [blame] | 9 | throw 'Skipped: cannot make screendumps' |
Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 10 | endif |
| 11 | |
| 12 | " This Vim is running with 'encoding' "utf-8", the Vim in the terminal is |
| 13 | " running with 'encoding' "euc-jp". We need to make sure the text is in the |
| 14 | " right encoding, this is a bit tricky. |
| 15 | func Test_termencoding_euc_jp() |
Drew Vogel | ea67ba7 | 2025-05-07 22:05:17 +0200 | [diff] [blame] | 16 | CheckScreendump |
Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 17 | new |
| 18 | call setline(1, 'E89: バッファ %ld の変更は保存されていません (! で変更を破棄)') |
| 19 | write ++enc=euc-jp Xeuc_jp.txt |
| 20 | quit |
| 21 | |
| 22 | call writefile([ |
| 23 | \ 'set encoding=euc-jp', |
| 24 | \ 'set termencoding=utf-8', |
| 25 | \ 'scriptencoding utf-8', |
| 26 | \ 'exe "normal aE83: バッファを作成できないので、他のを使用します...\<Esc>"', |
| 27 | \ 'split Xeuc_jp.txt', |
Bram Moolenaar | c4860bd | 2022-10-15 20:52:26 +0100 | [diff] [blame] | 28 | \ ], 'XTest_tenc_euc_jp', 'D') |
Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 29 | let buf = RunVimInTerminal('-S XTest_tenc_euc_jp', {'rows': 10}) |
| 30 | call VerifyScreenDump(buf, 'Test_tenc_euc_jp_01', {}) |
| 31 | |
| 32 | " clean up |
| 33 | call StopVimInTerminal(buf) |
| 34 | call delete('Xeuc_jp.txt') |
Bram Moolenaar | 617d7ef | 2019-01-17 13:04:30 +0100 | [diff] [blame] | 35 | endfunc |
Bram Moolenaar | 6d91bcb | 2020-08-12 18:50:36 +0200 | [diff] [blame] | 36 | |
| 37 | " vim: shiftwidth=2 sts=2 expandtab |