Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD make83Name doesn't allow extended ASCII characters #3

Open
agdl opened this issue Jul 12, 2016 · 2 comments · May be fixed by #83
Open

SD make83Name doesn't allow extended ASCII characters #3

agdl opened this issue Jul 12, 2016 · 2 comments · May be fixed by #83
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@agdl
Copy link
Member

agdl commented Jul 12, 2016

From @mcaldwelva on November 9, 2015 23:5

This line of code is overly restrictive:

if (i > n || c < 0X21 || c > 0X7E)return false;

Windows will use extended ASCII in short file names if they are present in the long file name. Based on the Wikipedia entry for FAT 8.3 file naming, something like this seems more appropriate:

if (i > n || c < 0x20 || c == 0x7F) return false;

I hope you will consider making a change along these lines in the future. Thanks!

Copied from original issue: arduino/Arduino#4121

@agdl
Copy link
Member Author

agdl commented Jul 12, 2016

From @cmaglie on November 11, 2015 15:23

@mcaldwelva
looking at this article from Microsoft:

https://support.microsoft.com/en-us/kb/142982

it seems that spaces are not allowed in 8.3 so they should not be allowed (with c < 0x20).

Also I'm not sure that extended chars (>0x7F) are allowed, the article above leave this case undefined. Are you sure that it's possible? Does this patch solve a real world issue?

@agdl
Copy link
Member Author

agdl commented Jul 12, 2016

From @mcaldwelva on November 12, 2015 3:55

Thanks for the quick response! Yes, this is a problem that anyone might
encounter. I discovered it when I realized that the SD library wasn't
finding several files on my card and narrowed it down to those with Latin
characters. Here are a couple examples of long names and the Windows
generated short names:

  1. ¿Por Qué Te Vas_.mp3
    06¿POR~1.MP3
  2. Penélope.mp3
    05PENÉ~1.MP3

Windows shouldn't generate short file names with spaces, but other systems
may. I believe space is allowed anywhere except for the first char, but
there is a separate line of code to handle that case. Thanks,

.Mike

On Wed, Nov 11, 2015 at 10:23 AM, Cristian Maglie [email protected]
wrote:

@mcaldwelva https://github.com/mcaldwelva
looking at this article from Microsoft:

https://support.microsoft.com/en-us/kb/142982

it seems that spaces are not allowed in 8.3 so they should not be allowed
(with c < 0x20).

Also I'm not sure that extended chars (>0x7F) are allowed, the article
above leave this case undefined. Are you sure that it's possible? Does this
patch solve a real world issue?


Reply to this email directly or view it on GitHub
arduino/Arduino#4121 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants