summaryrefslogtreecommitdiff
path: root/fs/cifs/cifs_unicode.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-09-05 08:38:11 -0400
committerSteve French <smfrench@gmail.com>2013-09-08 14:38:05 -0500
commitc2ccf53dd0ddf0b48e68206c1abb99536851c7b2 (patch)
tree3200c6fb4e36fb9ce5489939ee55fe09fcdb1ed2 /fs/cifs/cifs_unicode.h
parent4adf53a9e0d3d447c7ebf510fcd337fdee8350bd (diff)
cifs: add new case-insensitive conversion routines that are based on wchar_t's
The existing NLS case conversion routines do not appropriately handle the (now common) case where the local host is using UTF8. This is because nls_utf8 has no support at all for converting a utf8 string between cases and the NLS infrastructure in general cannot handle a multibyte input character. In any case, what we really need for cifs is to emulate how we expect the server to convert the character to upper or lowercase. Thus, even if we had routines that could handle utf8 case conversion, we likely would end up with the wrong result if the name ends up being in the upper planes. This patch adds a new scheme for doing unicode case conversion. The case conversion tables that Microsoft has published for Windows 8 have been converted to a set of lookup tables, and a routine is added to convert a wchar_t from lower to uppercase using those tables. Reported-and-Tested-by: Jan-Marek Glogowski <glogow@fbihome.de> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifs_unicode.h')
-rw-r--r--fs/cifs/cifs_unicode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h
index fe8d6276410..d8eac3b6cef 100644
--- a/fs/cifs/cifs_unicode.h
+++ b/fs/cifs/cifs_unicode.h
@@ -91,6 +91,8 @@ extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen,
#endif /* CONFIG_CIFS_SMB2 */
#endif
+wchar_t cifs_toupper(wchar_t in);
+
/*
* UniStrcat: Concatenate the second string to the first
*