mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.0554: toupper and tolower don't work properly for Turkish
Problem: Toupper and tolower don't work properly for Turkish when 'casemap' contains "keepascii". (Bjorn Linse) Solution: When 'casemap' contains "keepascii" use ASCII toupper/tolower.
This commit is contained in:
@@ -1733,6 +1733,8 @@ vim_toupper(int c)
|
|||||||
if (enc_latin1like)
|
if (enc_latin1like)
|
||||||
return latin1upper[c];
|
return latin1upper[c];
|
||||||
}
|
}
|
||||||
|
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||||
|
return TOUPPER_ASC(c);
|
||||||
return TOUPPER_LOC(c);
|
return TOUPPER_LOC(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1757,6 +1759,8 @@ vim_tolower(int c)
|
|||||||
if (enc_latin1like)
|
if (enc_latin1like)
|
||||||
return latin1lower[c];
|
return latin1lower[c];
|
||||||
}
|
}
|
||||||
|
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||||
|
return TOLOWER_ASC(c);
|
||||||
return TOLOWER_LOC(c);
|
return TOLOWER_LOC(c);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1619,6 +1619,17 @@ fun! Test_normal30_changecase()
|
|||||||
call assert_equal("i\u0131", getline(1))
|
call assert_equal("i\u0131", getline(1))
|
||||||
call assert_equal("i\u0131", tolower("iI"))
|
call assert_equal("i\u0131", tolower("iI"))
|
||||||
|
|
||||||
|
set casemap&
|
||||||
|
call setline(1, 'iI')
|
||||||
|
1normal gUU
|
||||||
|
call assert_equal("II", getline(1))
|
||||||
|
call assert_equal("II", toupper("iI"))
|
||||||
|
|
||||||
|
call setline(1, 'iI')
|
||||||
|
1normal guu
|
||||||
|
call assert_equal("ii", getline(1))
|
||||||
|
call assert_equal("ii", tolower("iI"))
|
||||||
|
|
||||||
lang en_US.UTF-8
|
lang en_US.UTF-8
|
||||||
catch /E197:/
|
catch /E197:/
|
||||||
" can't use Turkish locale
|
" can't use Turkish locale
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
554,
|
||||||
/**/
|
/**/
|
||||||
553,
|
553,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user