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

Rendering an image where filename contains special characters (ä, ö, ü, ß) fails #136

Open
ChrisKaun opened this issue Jul 15, 2019 · 2 comments
Labels

Comments

@ChrisKaun
Copy link

Hey,

I'm rendering an image to sablon content via uri and filename Sablon.content(:image, uri, filename: name).
If the name variable contains any special characters like ä, ü, ö, ß this will fail and sablon will display a blackish image replacement instead.

@stadelmanma
Copy link
Collaborator

I suspect this is a limitation in MS Word since that "name" parameter is used as the filename inside the DOCX zip file structure. Word gets around this by renaming everything image1, image2, etc. My advice would be to just strip out the special characters entirely.

@ChrisKaun
Copy link
Author

As you already mentioned a valid work around in my case is to strip the special characters from the file name.
What happens when a file is directly loaded from a path, without specifying a filename parameter?
Sablon.content(:image, 'fixtures/images/c3pö.jpg')
Would this still fail?

Don't think that the special characters should be stripped inside the sablon-code, but a note should be added to the docs that some characters might not be supported.

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

No branches or pull requests

2 participants