Rename flag. Turn on UTF-8 and flag on unix
Also added label portion to the test.
This commit is contained in:
parent
1197394a03
commit
144aed40e3
|
@ -499,7 +499,7 @@ DWORD ff_wtoupper ( /* Returns up-converted code point */
|
||||||
DWORD uni /* Unicode code point to be up-converted */
|
DWORD uni /* Unicode code point to be up-converted */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if FF_FS_ASCII_UPPER_ONLY
|
#if FF_FS_CASE_INSENSITIVE_COMPARISON_ASCII_ONLY
|
||||||
// Only uppercase ASCII characters. Everything else will require the user to
|
// Only uppercase ASCII characters. Everything else will require the user to
|
||||||
// pass in an uppercase version.
|
// pass in an uppercase version.
|
||||||
if ('a' <= uni && uni <= 'z') {
|
if ('a' <= uni && uni <= 'z') {
|
||||||
|
|
|
@ -178,6 +178,9 @@
|
||||||
#define MICROPY_FATFS_RPATH (2)
|
#define MICROPY_FATFS_RPATH (2)
|
||||||
#define MICROPY_FATFS_MAX_SS (4096)
|
#define MICROPY_FATFS_MAX_SS (4096)
|
||||||
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
|
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
|
||||||
|
#define MICROPY_FATFS_LFN_UNICODE (2)
|
||||||
|
|
||||||
|
#define FF_FS_CASE_INSENSITIVE_COMPARISON_ASCII_ONLY (1)
|
||||||
|
|
||||||
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
|
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
|
||||||
// names in exception messages (may require more RAM).
|
// names in exception messages (may require more RAM).
|
||||||
|
|
|
@ -595,7 +595,7 @@ void supervisor_run_background_tasks_if_tick(void);
|
||||||
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (0)
|
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FF_FS_ASCII_UPPER_ONLY (1)
|
#define FF_FS_CASE_INSENSITIVE_COMPARISON_ASCII_ONLY (1)
|
||||||
|
|
||||||
#define FF_FS_MAKE_VOLID (1)
|
#define FF_FS_MAKE_VOLID (1)
|
||||||
|
|
||||||
|
|
|
@ -51,18 +51,29 @@ vfs = uos.VfsFat(bdev)
|
||||||
uos.mount(vfs, "/ramdisk")
|
uos.mount(vfs, "/ramdisk")
|
||||||
uos.chdir("/ramdisk")
|
uos.chdir("/ramdisk")
|
||||||
|
|
||||||
|
vfs.label = "labelæ"
|
||||||
|
# This label would normally be LABELÆ but our limited upper casing does "LABELæ"
|
||||||
|
print(vfs.label)
|
||||||
|
|
||||||
# Check ASCII case-insensitivity
|
# Check ASCII case-insensitivity
|
||||||
vfs.mkdir("foo_dir_az")
|
vfs.mkdir("fooaz")
|
||||||
print(uos.listdir(""))
|
print(uos.listdir(""))
|
||||||
vfs.rmdir("fOO_dir_AZ")
|
vfs.rmdir("fOOAZ")
|
||||||
|
|
||||||
|
# Check ASCII case-insensitivity for long names (8+ characters)
|
||||||
|
vfs.mkdir("123456789fooaz")
|
||||||
|
print(uos.listdir(""))
|
||||||
|
vfs.rmdir("123456789fOOAZ")
|
||||||
|
|
||||||
# Characters outside of a-z are case sensitive.
|
# Characters outside of a-z are case sensitive.
|
||||||
vfs.mkdir("extended_æ")
|
vfs.mkdir("extended_æ")
|
||||||
print(uos.listdir(""))
|
print(uos.listdir(""))
|
||||||
|
# Normally this would work ok. With our limited uppercasing, it won't.
|
||||||
try:
|
try:
|
||||||
vfs.rmdir("extended_Æ")
|
vfs.rmdir("extended_Æ")
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(e.errno == uerrno.ENOENT)
|
print(e.errno == uerrno.ENOENT)
|
||||||
|
|
||||||
vfs.rmdir("extended_æ")
|
vfs.rmdir("extended_æ")
|
||||||
|
|
||||||
# Emoji test for fun.
|
# Emoji test for fun.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
['foo_dir_az']
|
LABELæ
|
||||||
|
['fooaz']
|
||||||
|
['123456789fooaz']
|
||||||
['extended_æ']
|
['extended_æ']
|
||||||
True
|
True
|
||||||
|
|
Loading…
Reference in New Issue