From 5d18e0eca59ffbba22c7f7c91c9f99d672095728 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 14 Apr 2016 22:54:24 +0200 Subject: patch 7.4.1742 Problem: strgetchar() does not work correctly. Solution: use mb_cptr2len(). Add a test. (Naruhiko Nishino) --- src/testdir/test_expr_utf8.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/testdir/test_expr_utf8.vim') diff --git a/src/testdir/test_expr_utf8.vim b/src/testdir/test_expr_utf8.vim index ec36deca9..c512ddf43 100644 --- a/src/testdir/test_expr_utf8.vim +++ b/src/testdir/test_expr_utf8.vim @@ -12,6 +12,10 @@ func Test_strgetchar() call assert_equal(char2nr('a'), strgetchar('àxb', 0)) call assert_equal(char2nr('̀'), strgetchar('àxb', 1)) call assert_equal(char2nr('x'), strgetchar('àxb', 2)) + + call assert_equal(char2nr('あ'), strgetchar('あaい', 0)) + call assert_equal(char2nr('a'), strgetchar('あaい', 1)) + call assert_equal(char2nr('い'), strgetchar('あaい', 2)) endfunc func Test_strcharpart() -- cgit v1.2.1