-
Notifications
You must be signed in to change notification settings - Fork 4
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
Explicit set utf-8 headers for file operations #157
Conversation
File operations need to have utf-8 headers otherwise special allowed characters will break the file action as they will encoded to ascii per default. Signed-off-by: Tobias Tschech <tobias@tschech-online.de>
for more information, see https://pre-commit.ci
Thanks for the pull request, and I have a question. I wanted to add a test for this |
it's easy. Scenario to reproduce: Create a file /documents/MyTestDocumentä.doc then try to move it with files.move to e.g. /trash/MyTestDocumentä.doc Important here is that the destination contains the "ä" because the destination is the value added to the header field. /document/MyTestDocumentä.doc -(move)-> /trash/MyTestDocument.doc WORKS This also happens with all non ASCII chars which are allowed as file or folder names in nextcloud. For example äöü from german umlauts. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #157 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 34 34
Lines 3134 3134
=======================================
Hits 3127 3127
Misses 7 7
|
I will add tests for this later today(and probably will check |
The same bug that was found in: #157 Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
File operations need to have utf-8 headers otherwise special allowed characters will break the file action as they will encoded to ascii per default.
Fixes #
If you have files with äöü etc. you will get an ascii encoding error cause of the reference in the Header.
This fixes this issue
Changes proposed in this pull request: