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

fix non-ascii filename mojibake when uploaded #3

Merged
merged 5 commits into from
Apr 30, 2020

Conversation

saitouena
Copy link
Contributor

@saitouena saitouena commented Oct 23, 2019

before: 日本語ファイル名.txt -> ?????.txt
after: 日本語ファイル名.txt -> 日本語ファイル名.txt

This patch requires patched version of clj-http (dakrone/clj-http#522), so CI fails for now.

how to try this patch

$ git clone git@github.com:toyokumo/clj-http.git
$ cd clj-http
$ git checkout add-option-to-add-multipart-charset
$ rm -rf ~/.m2/repository/clj-http/clj-http/3.10.1-SNAPSHOT/ # if needed
$ lein install
$ cd ..
$ git clone git@github.com:toyokumo/kintone-clj.git
$ git checkout fix-filename-mojibake
  • add a kintone app that has 添付ファイル field
  • add dev-resources/config.edn
{:auth {:basic {:username "hoge" :password "hoge"}
        :api-token "hoge"}
 :domain "hoge"
 :app 999999999}
  • try dev/test.clj.

This is a draft for now (waiting for dakrone/clj-http#522 to be merged).

before: 日本語ファイル名.txt -> ?????.txt
after: 日本語ファイル名.txt -> 日本語ファイル名.txt
@saitouena
Copy link
Contributor Author

saitouena commented Nov 8, 2019

This is a draft for now (waiting for dakrone/clj-http#522 to be merged).

Merged. Waiting for next release.

@saitouena saitouena marked this pull request as ready for review April 14, 2020 00:33
@saitouena saitouena requested review from makinoshi and removed request for makinoshi April 14, 2020 00:33
@saitouena
Copy link
Contributor Author

dev/test.clj is ok

Loading dev/test.clj... done
(run-tests 'test)

Testing test

Ran 16 tests containing 42 assertions.
0 failures, 0 errors.
=> {:test 16, :pass 42, :fail 0, :error 0, :type :summary}

I also manually checked that file-upload uploads 日本語ファイル名.txt correctly.

Screenshot from 2020-04-14 10-41-23

@saitouena
Copy link
Contributor Author

1d11e29 is redundant, but don't care

Copy link
Member

@makinoshi makinoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@makinoshi makinoshi merged commit 9d876f8 into master Apr 30, 2020
@makinoshi makinoshi deleted the fix-filename-mojibake branch April 30, 2020 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants