+
+/*
+ * In FatFs menuconfig, set CONFIG_FATFS_API_ENCODING to UTF-8 and set the
+ * Codepage to CP936 (Simplified Chinese) in order to run the following tests.
+ * Ensure that the text editor is UTF-8 compatible when compiling these tests.
+ */
+#if defined(CONFIG_FATFS_API_ENCODING_UTF_8) && (CONFIG_FATFS_CODEPAGE == 936)
+
+static const char* test_filename_utf_8 = "/sdcard/测试文件.txt";
+
+TEST_CASE("(SD) can read file using UTF-8 encoded strings", "[fatfs][sd][test_env=UT_T1_SDMODE]")
+{
+ test_setup();
+ test_fatfs_create_file_with_text(test_filename_utf_8, fatfs_test_hello_str_utf);
+ test_fatfs_read_file_utf_8(test_filename_utf_8);
+ test_teardown();
+}
+
+TEST_CASE("(SD) opendir, readdir, rewinddir, seekdir work as expected using UTF-8 encoded strings", "[fatfs][ignore]")
+{
+ test_setup();
+ test_fatfs_opendir_readdir_rewinddir_utf_8("/sdcard/目录");
+ test_teardown();
+}
+#endif // CONFIG_FATFS_API_ENCODING_UTF_8 && CONFIG_FATFS_CODEPAGE == 936