← Back to team overview

kicad-developers team mailing list archive

Re: Github part footprint filenames

 

On 8/21/2013 12:39 PM, Lorenzo Marcantonio wrote:
> On Wed, Aug 21, 2013 at 11:20:28AM -0400, Wayne Stambaugh wrote:
>> make sure your file names are valid on all platforms.  I think there are
>> a few characters that are valid on *nix that are not valid on windows.

I should have qualified that with the utf8 character set because
internally all of our file parsers work on utf8 encoded files.

> 
> This is the authoritative source:
> 
> http://support.microsoft.com/kb/177506
> 
> The POSIX rule instead is "any octet except NUL and slash". Of course
> pain *will* occur when applying strange names... also IIRC there are
> more limitations when 'extended' character are in use (and folders don't
> scale well to thousands of files).
> 
> I'd also exclude the RFC3986 reserved characters, for obvious reasons.
> 
> IMHO it's best to stick to some conservative set, like alphanumerics and
> a couple of symbols like - and maybe _. Add . and ~ and you have the
> RFC3986 unreserved character set, neat. Do we really need spaces and
> quotes and whatever in a symbol name?
> 
> Then one user will want to name is footprint "Thæt Fòótprint previously
> known as "\_/" :)" and maybe with a cow picture inside. What will we
> do?
> 
> We either:
> 1) apply robust quoting rules in whatever context they are used (sexp,
>    URI, whatever). The current sexp rule is (very) inconvenient to parse but at
>    least is robust. URI encoding is probably readily available in some
>    other library.
> 
> or
> 
> 2) restrict to a 'safe' set and enforcing it on the input

While I agree with you on principal, anyone could create a kicad_mod
file by hand and name it anything the platform accepts.  There is no way
to enforce that.  As long as the file name can be parsed in from the
appropriate KiCad file, we should be able to open it.  At least that
should be goal.

> 
> also... will it be case sensitive/insensitive/preserving?

For platform compatibility or you footprint libraries you will have to
name your footprint files accordingly but internally the case
sensitivity will platform dependent.  In other words 74ls04.kicad_mod
and 74LS04.kicad_mod in the same library on windows will not be
possible.  Hopefully *nix folks wont do that either but there would be
nothing preventing them from doing that.  Otherwise their libraries
and/or projects will not be portable.  I prefer not to force windows
short comings on *nix users and I'm pretty sure they don't want that
forced upon them :).

> 
> Just decide and implement as decided.
> 




Follow ups

References