Handle UTF in long filenames (#20087)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
LinFor
2020-11-11 23:14:39 +03:00
committed by GitHub
parent 0465e0ae3a
commit 5b9aeb2e5f
5 changed files with 124 additions and 100 deletions

View File

@@ -103,5 +103,10 @@
#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry
// UTF-8 may use up to 3 bytes to represent single UTF-16 code point.
// We discard 3-byte characters allowing only 2-bytes
// or 1-byte if UTF_FILENAME_SUPPORT disabled.
#define LONG_FILENAME_CHARSIZE TERN(UTF_FILENAME_SUPPORT, 2, 1)
// Total bytes needed to store a single long filename
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1)
#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * LONG_FILENAME_CHARSIZE * MAX_VFAT_ENTRIES + 1)