From: Janne Grunau <j@jannau.net>
To: Anatolij Gustschin <agust@denx.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Simon Glass <sjg@chromium.org>,
Andre Przywara <andre.przywara@arm.com>,
u-boot@lists.denx.de, Janne Grunau <j@jannau.net>
Subject: [PATCH v3 7/7] efi_selftest: Update StrToFat() unit test after CP473 map extension
Date: Sat, 16 Mar 2024 22:50:24 +0100 [thread overview]
Message-ID: <20240316-vidconsole-utf8-uefi-v3-7-4e8a3d349447@jannau.net> (raw)
In-Reply-To: <20240316-vidconsole-utf8-uefi-v3-0-4e8a3d349447@jannau.net>
Test that Unicode code points which map to CP437 code points 1-31 are
converted to '_'. This ensures no FAT file names do not contain chars
which are control characters in other code pages (CP 1250 for example).
Signed-off-by: Janne Grunau <j@jannau.net>
---
lib/efi_selftest/efi_selftest_unicode_collation.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/efi_selftest/efi_selftest_unicode_collation.c b/lib/efi_selftest/efi_selftest_unicode_collation.c
index 32c99caf35..ad7dfa9fb9 100644
--- a/lib/efi_selftest/efi_selftest_unicode_collation.c
+++ b/lib/efi_selftest/efi_selftest_unicode_collation.c
@@ -220,6 +220,18 @@ static int test_str_to_fat(void)
return EFI_ST_FAILURE;
}
+ /*
+ * Test unicode code points which map to CP 437 0x01 - 0x1f are
+ * converted to '_'.
+ */
+ boottime->set_mem(fat, 16, 0);
+ ret = unicode_collation_protocol->str_to_fat(unicode_collation_protocol,
+ u"\u263a\u2666\u2022\u25d8\u2642\u2194\u00b6\u203c", 8, fat);
+ if (!ret || efi_st_strcmp_16_8(u"________", fat)) {
+ efi_st_error("str_to_fat returned %u, \"%s\"\n", ret, fat);
+ return EFI_ST_FAILURE;
+ }
+
return EFI_ST_SUCCESS;
}
--
2.44.0
prev parent reply other threads:[~2024-03-16 21:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-16 21:50 [PATCH v3 0/7] video: Add UTF-8 support for UEFI applications Janne Grunau
2024-03-16 21:50 ` [PATCH v3 1/7] lib: charset: Fix and extend utf8_to_utf32_stream() documentation Janne Grunau
2024-03-16 21:50 ` [PATCH v3 2/7] video: console: Parse UTF-8 character sequences Janne Grunau
2024-03-16 21:50 ` [PATCH v3 3/7] lib/charset: Map Unicode code points to CP437 code points 1-31 Janne Grunau
2024-03-16 21:50 ` [PATCH v3 4/7] efi_selftest: Add international characters test Janne Grunau
2024-03-16 21:50 ` [PATCH v3 5/7] efi_selftest: Add box drawing character selftest Janne Grunau
2024-03-16 21:50 ` [PATCH v3 6/7] efi_selftest: Add geometric shapes " Janne Grunau
2024-03-16 21:50 ` Janne Grunau [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240316-vidconsole-utf8-uefi-v3-7-4e8a3d349447@jannau.net \
--to=j@jannau.net \
--cc=agust@denx.de \
--cc=andre.przywara@arm.com \
--cc=ilias.apalodimas@linaro.org \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).