vim-patch:8.1.0059: displayed digraph for "ga" wrong with 'encoding' "cp1251"

Problem:    Displayed digraph for "ga" wrong with 'encoding' "cp1251".
Solution:   Convert from 'encoding' to "utf-8" if needed. (closes vim/vim#3015)
bc5020aa4d
This commit is contained in:
Jan Edmund Lazo 2019-10-05 22:59:31 -04:00
parent 5581ffac74
commit b007e5d882
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 15 additions and 1 deletions

View File

@ -1450,8 +1450,9 @@ int do_digraph(int c)
/// Find a digraph for "val". If found return the string to display it. /// Find a digraph for "val". If found return the string to display it.
/// If not found return NULL. /// If not found return NULL.
char_u *get_digraph_for_char(int val) char_u *get_digraph_for_char(int val_arg)
{ {
const int val = val_arg;
digr_T *dp; digr_T *dp;
static char_u r[3]; static char_u r[3];

View File

@ -465,4 +465,17 @@ func Test_show_digraph()
bwipe! bwipe!
endfunc endfunc
func Test_show_digraph_cp1251()
throw 'skipped: Nvim supports ''utf8'' encoding only'
if !has('multi_byte')
return
endif
new
set encoding=cp1251
call Put_Dig("='")
call assert_equal("\n<\xfa> <|z> <M-z> 250, Hex fa, Oct 372, Digr ='", execute('ascii'))
set encoding=utf-8
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab