diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2011-11-17 16:42:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 13:51:01 -0500 |
commit | 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd (patch) | |
tree | 6895ca20afb24b38f0246b370cba7dc6e72764cb /include/linux/nls.h | |
parent | b7463c71fbbff7111d0c879d2f64fe2b08f51848 (diff) |
NLS: improve UTF8 -> UTF16 string conversion routine
The utf8s_to_utf16s conversion routine needs to be improved. Unlike
its utf16s_to_utf8s sibling, it doesn't accept arguments specifying
the maximum length of the output buffer or the endianness of its
16-bit output.
This patch (as1501) adds the two missing arguments, and adjusts the
only two places in the kernel where the function is called. A
follow-on patch will add a third caller that does utilize the new
capabilities.
The two conversion routines are still annoyingly inconsistent in the
way they handle invalid byte combinations. But that's a subject for a
different patch.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/nls.h')
-rw-r--r-- | include/linux/nls.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/nls.h b/include/linux/nls.h index d47beef08dfd..5dc635f8d79e 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
@@ -43,7 +43,7 @@ enum utf16_endian { | |||
43 | UTF16_BIG_ENDIAN | 43 | UTF16_BIG_ENDIAN |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /* nls.c */ | 46 | /* nls_base.c */ |
47 | extern int register_nls(struct nls_table *); | 47 | extern int register_nls(struct nls_table *); |
48 | extern int unregister_nls(struct nls_table *); | 48 | extern int unregister_nls(struct nls_table *); |
49 | extern struct nls_table *load_nls(char *); | 49 | extern struct nls_table *load_nls(char *); |
@@ -52,7 +52,8 @@ extern struct nls_table *load_nls_default(void); | |||
52 | 52 | ||
53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); | 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); |
54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); | 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); |
55 | extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); | 55 | extern int utf8s_to_utf16s(const u8 *s, int len, |
56 | enum utf16_endian endian, wchar_t *pwcs, int maxlen); | ||
56 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, | 57 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, |
57 | enum utf16_endian endian, u8 *s, int maxlen); | 58 | enum utf16_endian endian, u8 *s, int maxlen); |
58 | 59 | ||