Not Serious, but a Thing with ActiveStorage #207
resistorsoftware
started this conversation in
General
Replies: 3 comments
-
Just to be clear. Here is the code and warning:
my_model.upload_file.open do |file|
SmarterCSV.process(file, chunk_size: 100, file_encoding: "UTF-8") do
|chunk|
Ready to work on the file that was uploaded
09:57:38 worker.1 | WARNING: you are trying to process UTF-8 input, but did
not open the input with "b:utf-8" option. See README file "NOTES about File
Encodings".
…On Mon, Mar 7, 2022 at 12:25 AM Tilo ***@***.***> wrote:
@resistorsoftware <https://github.com/resistorsoftware> did you specify file_encoding:
"UTF-8" ?
https://github.com/tilo/smarter_csv/blob/5d2979be04ec1a6a36bc9da77cb84d91f5a4ece8/lib/smarter_csv/smarter_csv.rb#L20
—
Reply to this email directly, view it on GitHub
<#186 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA6DK2S7BBQHFG5J7FQLPTU6WHNFANCNFSM5PSU5YRQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
that's a great question.. which |
Beta Was this translation helpful? Give feedback.
0 replies
-
@resistorsoftware can try to use this value for file_encoding: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you open a file saved using ActiveStorage, you get a properly encoded UTF-8 file if the file was properly encoded UTF-8. If you then attack that open file with SmarterCSV, it throws this message:
WARNING: you are trying to process UTF-8 input, but did not open the input with "b:utf-8" option. See README file "NOTES about File Encodings".
I am pretty sure you cannot control how you open a file using ActiveStorage, as you just get the method "open" and not way to apply any features to that. So this message leads to a dead end. If anyone knows how to turn off this warning, that would be swell to know!
Beta Was this translation helpful? Give feedback.
All reactions