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

Feature request: replace symbols #13

Open
thghca opened this issue Apr 30, 2021 · 4 comments
Open

Feature request: replace symbols #13

thghca opened this issue Apr 30, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@thghca
Copy link

thghca commented Apr 30, 2021

Hi. I'm using espwebdav for file upload and it buggy with non ascii and some other chars. Marlin may not like them too. Renaming every time annoying.

Would it possible to implement simple character replace table? And length limiting will be nice too.

@rgomezjnr
Copy link
Owner

Hello I'm not familiar with espwebdav and webdav so I will have to do some research on its filename limitations. Are you using espwebdav with a Wifi SD card?

What GFF format are you using? Can you give me an example of the filename that Cura and GFF are producing from your sliced objects?

@rgomezjnr rgomezjnr self-assigned this May 14, 2021
@rgomezjnr rgomezjnr added the enhancement New feature or request label May 14, 2021
@rgomezjnr
Copy link
Owner

Hello @thghca do you still have this issue? Or did you find another solution?

@thghca
Copy link
Author

thghca commented Sep 1, 2021

Hi. I had troubles with non ASCII (russian letters), some special characters like %&<>#$... and whitespaces.
For now i forked ESpWebDAV and made it work with utf8 and whitespaces. (I hope. Not much tested yet)
% and & and maybe others still issue, so i just reject filenames with them on server side.

Well Issue mostly resolved but some simple replace functionality will be good. (filter out problematic chars, replace whitespaces with underscore...)

Heh. Printer can't display russian characters. =(

@rgomezjnr
Copy link
Owner

Can you give me an example filename format you are attempting to use so I can test?

Hi. I had troubles with non ASCII (russian letters), some special characters like %&<>#$... and whitespaces.

GFF does support whitespace, which makes me think this is more so a character encoding issue.

I can easily add support for additional characters like &, #.

FYI this is the current regex used in GFF for determining acceptable filenames. The characters after \ "-%°$£€" are accepted and should be included in the filename.

filename_format = re.sub('[^A-Za-z0-9._\-%°$£€ ]+', '', filename_format)

If the characters listed above aren't working for you then I need to see an example of how you're using them to see if they are being filtered out by the regex.

Well Issue mostly resolved but some simple replace functionality will be good. (filter out problematic chars, replace whitespaces with underscore...)
Marlin may not like them too.
Heh. Printer can't display russian characters. =(

It doesn't make sense to implement character replacement in GFF if the 3D printer can't support them anyways. So I think its better to cleanup the filename before it gets to Cura and GFF. Can I help you implement filename sanitization on your server or ESpWebDAV?

Also, if you're interested, I recently released a newer version of the plugin called GcodeFilenameFormatPlus that supports multi-extruder printers and the OctoPrint server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants