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

encode UTF-8 YAML::XS::Dump #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

s1037989
Copy link

@s1037989 s1037989 commented Jul 3, 2023

Summary

encode UTF-8 YAML::XS::Dump in Minion Admin list jobs

Motivation

Is this an appropriate thing to do? I have notes with utf8 and they don't show up right in the Admin page, but adding this make it show up right. Is there another way to get the notes to render UTF-8 correctly?

Is this an appropriate thing to do?  I have notes with utf8 and they don't show up right in the Admin page, but adding this make it show up right.  Is there another way to get the notes to render UTF-8 correctly?
@rabbiveesh
Copy link

Officially, JSON is supposed to always be UTF-8, but at least for postgres, the json is practically stored in DB encoding. I would imagine that this patch is sane, nonetheless

@kraih
Copy link
Member

kraih commented Jul 3, 2023

I think _dump is used in multiple places and one of them probably prints to a terminal, where this would break unicode.

@s1037989
Copy link
Author

s1037989 commented Jul 3, 2023

Would it be an acceptable patch to add this function alphabetically?

sub _decoded_dump { Mojo::Util::decode 'UTF-8', _dump(@_) }

And then on L158 of jobs.html.ep:

<pre class="border rounded"><%= Minion::_decoded_dump(Minion::_datetime($job)) %></pre>

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.

3 participants