From 9df157b4ed52108495de9f8bc77ef922034e3b66 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Mon, 21 Mar 2022 09:25:05 -0300 Subject: iconv: Add UTF-7-IMAP variant in utf-7.c UTF-7-IMAP differs from UTF-7 in the followings ways (see RFC 3501[1] for reference) : - The shift character is '&' instead of '+' - There is no "optional direct characters" and the "direct characters" set is different - There is no implicit shift back to US-ASCII from BASE64, all BASE64 sequences MUST be terminated with '-' [1]: https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3 Signed-off-by: Max Gautier Reviewed-by: Adhemerval Zanella --- iconvdata/testdata/UTF-7-IMAP..UTF8 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 iconvdata/testdata/UTF-7-IMAP..UTF8 (limited to 'iconvdata/testdata/UTF-7-IMAP..UTF8') diff --git a/iconvdata/testdata/UTF-7-IMAP..UTF8 b/iconvdata/testdata/UTF-7-IMAP..UTF8 new file mode 100644 index 0000000000..8b9add3670 --- /dev/null +++ b/iconvdata/testdata/UTF-7-IMAP..UTF8 @@ -0,0 +1,32 @@ +አማርኛ Amharic +česky Czech +Dansk Danish +English English +Suomi Finnish +Français French +Deutsch German +Ελληνικά Greek +עברית Hebrew +Italiano Italian +Norsk Norwegian +Русский Russian +Español Spanish +Svenska Swedish +ภาษาไทย Thai +Türkçe Turkish +Tiếng Việt Vietnamese +日本語 Japanese +中文 Chinese +한글 Korean + +// Checking for correct handling of shift characters ('&', '-') after base64 sequences +한글& +한글- + +// Checking for correct handling of litteral '&' and '-' +---&&- + +// The last line of this file is missing the end-of-line terminator +// on purpose, in order to test that the conversion empties the bit buffer +// and shifts back to the initial state at the end of the conversion. +A≢Α \ No newline at end of file -- cgit v1.2.3