From ac4caab8f1500d044df48a7855eb9d30021afd70 Mon Sep 17 00:00:00 2001 From: Blue-Marlin Date: Sat, 30 Apr 2016 17:37:22 +0200 Subject: [PATCH] Don't mangel 8.3-filenames with chars > 0x7f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't mangel 8.3-filenames with chars > 0x7f Windows produces 8.3filenames wit chars > 0x7f. Those have been rejected by Marlin until now. With these 'malformed' filenames can now be worked with: In the LCD menue With RepetierHost (V1.6.1 tested) - full support. Characters are displayed as '?' With Octoprint (1.2.10 tested) the files do not appear in the files area. At the console, listed with M20 they appear with a '�'. With Pronterface the files appear in the sd-window but you can't start them. They are mangled by pronterface. The names are altered and than recected by Marlin. In the console they apper with differen but not the correct characters. All in all a little step forward. Fix for #3593 --- Marlin/SdBaseFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/SdBaseFile.cpp b/Marlin/SdBaseFile.cpp index 472a60a56..4927ab2e2 100644 --- a/Marlin/SdBaseFile.cpp +++ b/Marlin/SdBaseFile.cpp @@ -405,7 +405,7 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) { uint8_t b; while ((b = pgm_read_byte(p++))) if (b == c) goto fail; // check size and only allow ASCII printable characters - if (i > n || c < 0X21 || c > 0X7E)goto fail; + if (i > n || c < 0X21 || c == 0X7E)goto fail; // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); }