diff src/charset.c @ 11337:f0fbebf19b80 v8.0.0554

patch 8.0.0554: toupper and tolower don't work properly for Turkish commit https://github.com/vim/vim/commit/1cc482069a3407132aeb43a55d6dc284153e79c7 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 9 13:41:59 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sun, 09 Apr 2017 13:45:03 +0200
parents fef09eb74832
children 4dba3e4f3b01
line wrap: on
line diff
--- a/src/charset.c
+++ b/src/charset.c
@@ -1733,6 +1733,8 @@ vim_toupper(int c)
 	if (enc_latin1like)
 	    return latin1upper[c];
     }
+    if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
+	return TOUPPER_ASC(c);
     return TOUPPER_LOC(c);
 }
 
@@ -1757,6 +1759,8 @@ vim_tolower(int c)
 	if (enc_latin1like)
 	    return latin1lower[c];
     }
+    if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
+	return TOLOWER_ASC(c);
     return TOLOWER_LOC(c);
 }
 #endif